UpdatePanel 之间的通信 ASP.Net
我已将一个树视图放置在一个更新面板中,并将每个视图放置在一个更新面板中 像这样的东西
<UpdatePanel id="UP1">
<ContentTemplate>
<TreeView/>
</ContentTemplate>
</UpdatePanel>
<MultiView>
<UpdatePanel id="UP2">
<View1/>
</UpdatePanel>
现在我想知道如何确保当我单击 TreeView 的任何节点时应显示相应的视图
I have placed a treeView in One Update Panel and Each View in one update Panel
something like this
<UpdatePanel id="UP1">
<ContentTemplate>
<TreeView/>
</ContentTemplate>
</UpdatePanel>
<MultiView>
<UpdatePanel id="UP2">
<View1/>
</UpdatePanel>
Now I want to know how I can make sure When I click any node of TreeView respective Views should get displayed
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您有 Treeview 的单击事件的代码,则另一种方法是从代码隐藏中调用 UP2.Update() 。 请记住,UP2 需要将其 RenderMode 设置为 Conditional 才能正常工作。 希望能帮助到你
Another way of approaching it would be to call UP2.Update() from the codebehind if you have code for the click event of the Treeview. Remember, UP2 needs to have its RenderMode set to Conditional for this to work. Hope it helps
将 AsyncPostBackTrigger 添加到第二个 updatePanel,以便在触发 TreeView Click 事件时更新它。
好的,这是一个工作示例。
标记:
背后的代码:
Add an AsyncPostBackTrigger to the second updatePanel, so it gets updated when the TreeView Click event is fired.
OK, Here Is a working Example.
The Markup:
The code behind: