【问题标题】:Clicking on treeview node disappears the treeview in asp.net. Why?单击树视图节点会消失 asp.net 中的树视图。为什么?
【发布时间】:2013-05-25 09:01:27
【问题描述】:

我在用户控件中绑定树视图控件。单击节点时,页面会显示树视图,并且 Tree_Index_SelectedNodeChanged 不会触发。并且应用程序中没有捕获到异常。

知道为什么吗?

实际上我已经使用相同的代码在 aspx 页面中绑定树视图,并且在单击树节点时它工作正常。

这是为两个看起来不同的页面的树视图节点呈现的 HTML。这会是个问题吗?

在 ASPX 中绑定的 Treeview(工作)

<td style="white-space:nowrap;"><a style="text-decoration:none;" id="ctl00_cphMain_Tree_Indext3" href="javascript:__doPostBack('ctl00$cphMain$Tree_Index','sSheltered Homes for the Aged')">Sheltered Homes for the Aged</a></td>

在 ASCX 中绑定的 Treeview(不工作)

<td style="white-space:nowrap;"><a id="ctl00_cphMain_447647F9-47FF-4FBD-8DE3-956EB1255383_Tree_Indext3" href="javascript:__doPostBack('ctl00$cphMain$447647F9-47FF-4FBD-8DE3-956EB1255383$Tree_Index','sSheltered Homes for the Aged')" class="ctl00_cphMain_447647F9-47FF-4FBD-8DE3-956EB1255383_Tree_Index_0">Sheltered Homes for the Aged</a></td>

【问题讨论】:

    标签: asp.net .net treeview


    【解决方案1】:

    这可能对你有帮助

    检查使用

    if(![postback)
    {
    
    }
    
    if(postback)
    {
    
    }
    

    或检查一下

    http://msdn.microsoft.com/en-us/magazine/cc163598.aspx

    【讨论】:

      猜你喜欢
      • 2013-07-13
      • 2011-02-20
      • 1970-01-01
      • 1970-01-01
      • 2014-08-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-12
      相关资源
      最近更新 更多