2013-04-24 20 views
1

我有TextBoxtreeview喜欢,使用的UpdatePanel的asp.net树视图SelectedNodeChanged事件

<asp:UpdatePanel ID="UpdatePanel1" runat="server"> 
<ContentTemplate> 
<asp:TextBox ID="txtName" runat="server" Width="150px" ReadOnly="true" 
BorderStyle="Double"> 
</asp:TextBox> 
</ContentTemplate> 
</asp:UpdatePanel> 

<asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows" 
OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" > 
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" 
NodeSpacing="0px" VerticalPadding="0px" /> 
<SelectedNodeStyle CssClass="treeHover"></SelectedNodeStyle> 
</asp:TreeView> 

编码SelectedNodeChanged事件,

我的更新面板不能正常工作,我想知道我的代码中有什么问题?

+0

る歌厅当乌尔在更新面板 – 2013-04-24 12:20:29

+0

把任何问题,看一看下面:http://msdn.microsoft.com/en-us/library/ bb399001(v = vs.100).aspx – mtsiakiris 2013-04-24 12:37:24

+0

@Amit Singh,我编辑了我的问题:) – zey 2013-04-25 04:35:29

回答

4

试试这个....

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> 
    <ContentTemplate> 
    <asp:TextBox ID="txtName" runat="server" Width="150px" ReadOnly="true" 
    BorderStyle="Double"> 
    </asp:TextBox> 
    </ContentTemplate> 
    <Triggers> 
      <asp:AsyncPostBackTrigger ControlID="TreeView1" EventName="SelectedNodeChanged" /> 
      </Triggers> 
    </asp:UpdatePanel> 

    <asp:TreeView ID="TreeView1" runat="server" ImageSet="Arrows" 
    OnSelectedNodeChanged="TreeView1_SelectedNodeChanged" > 
    <NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="5px" 
    NodeSpacing="0px" VerticalPadding="0px" /> 
    <SelectedNodeStyle CssClass="treeHover"></SelectedNodeStyle> 
    </asp:TreeView> 
+0

:D,感谢'触发器! – zey 2013-04-25 04:45:29

+0

欢迎@zey ... – 2013-04-25 04:45:52

+0

非常感谢,您拯救了我的一天。 – CYB 2014-02-23 09:04:52

相关问题