您的位置:首页 > 其它

ICallbackEventHandler接口实现多级联动 (转)

2007-05-19 13:23 447 查看
从一位老兄的Blog上看到了这个,可是代码却不太全(至少我这里看不全)。于是想办法补充了一点:
1、客户端脚本:

1 function CallServer()
2
7 function ReceiveServerData(rValue)
8
15 function selectChange(e)
16
26 function selectSon(e)
27
31 function ReceiveServerData(rValue)
32 /////////////////////
42 function selectChangeSon(e)
43
53 function select(e)
54
58 function hello(rValue)
59</script>
2、aspx页面代码

1 <select id="SelParent" runat="server" onchange="selectChange(this)">
2 <option selected="selected" value="0">请选择 </option>
3 </select>
4 <br />
5 <select id="SelSon" runat="server" onchange="selectChangeSon(this)">
6 <option selected="selected" value="0">请选择 </option>
7 </select>
8 <br />
9 <select id="Sel">
10 <option selected="selected" value="0">请选择</option>
11 </select>
3、服务器端代码

1 OracleConnection conn = new OracleConnection("Data Source=?;UID=?;PWD=?");
2
3
4 protected void Page_Load(object sender, EventArgs e)
5
6
12
13 private string resualt;
14
15
16 private void ParentBind()
17
18
32 private string SonBind(string e)//绑定第二级
33
34
50
51
52 private string ChildBind(string e)//绑定第三级
53
54
70
71
72 private DataSet ExecuteSql4Ds(string str)
73
74
90 void ICallbackEventHandler.RaiseCallbackEvent(String eventArgument)
91
92
116 string ICallbackEventHandler.GetCallbackResult()
117
118 {
119
120 return resualt;
121
122 }

4、数据库脚本

1 create table MULTIMENU
2 (
3 ID NUMBER(2) not null,
4 CID NUMBER(2) not null,
5 DSCT VARCHAR2(30) not null,
6 CCID NUMBER(2),
7 CCCID NUMBER(3)
8 )
9
10
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: