coolite TreeNode NodeClick传id到后台的方法
重点如下:
1 <AjaxEvents>
2 <Click OnEvent="PanelTree_Click" >
3 <EventMask ShowMask="true" Msg="正在执行,请稍后" />
4 <ExtraParams>
5 <ext:Parameter Name="Id" Value="node.id" Mode="Raw"></ext:Parameter>
6 </ExtraParams>
7 </Click>
8
9 </AjaxEvents>
2 <Click OnEvent="PanelTree_Click" >
3 <EventMask ShowMask="true" Msg="正在执行,请稍后" />
4 <ExtraParams>
5 <ext:Parameter Name="Id" Value="node.id" Mode="Raw"></ext:Parameter>
6 </ExtraParams>
7 </Click>
8
9 </AjaxEvents>
<ext:Parameter Name="Id" Value="node.id" Mode="Raw"></ext:Parameter>
这边value="node.id"就可以饿了,模式一定要改为Raw
code Behind
1 [AjaxMethod]
2 protected void PanelTree_Click(object sender,AjaxEventArgs e)
3 {
4 string str = e.ExtraParams["Id"];
5 if (string.IsNullOrEmpty(str) || str=="root")
6 {
7 BuildDataTable();
8 }
9 else
10 {
11 BuildDataTable(int.SafeParse(str));
12 }
13 }
2 protected void PanelTree_Click(object sender,AjaxEventArgs e)
3 {
4 string str = e.ExtraParams["Id"];
5 if (string.IsNullOrEmpty(str) || str=="root")
6 {
7 BuildDataTable();
8 }
9 else
10 {
11 BuildDataTable(int.SafeParse(str));
12 }
13 }
来源:http://www.cnblogs.com/yzhxhwt/archive/2009/07/16/1524547.html