在客户端填充ASP.NET Treeview [英] Populate ASP.NET Treeview on the client side

查看:114
本文介绍了在客户端填充ASP.NET Treeview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ASP.NET Treeview.在文本框中输入搜索条件并单击一个按钮时,需要填充它.我想避免发布整个页面.我可以很容易地实现不通过客户端回调来发布整个页面,但是当我必须在JavaScript中填充Treeview 时,问题就来了.据我所知,我必须将所有级别创建为HTML表-行/单元格,添加我自己的扩展和折叠事件处理程序等,而这是我想要避免的.我希望能够使用treeview PopulateOnDemand PopulateNodesFromClient 功能的现有功能.当我单击根节点或任何后续节点而没有任何问题时(当说对我的Webservice调用的初始输入经过硬编码以获取treeview 数据时),在Treeview 动作上效果很好.我的主要问题是如何首先使用输入的输入和客户端上的按钮单击来填充treeview .客户端需要某种将datasource 绑定到Treeview 的方式-无论我是使用旧的传统客户端回调方法还是在Apxax标记本身上使用AJAX之类的C#方法.

I am using ASP.NET Treeview. I need to populate it upon entering a search criteria in a text box and clicking a button. I want to avoid posting the whole page. I can very easily achieve not posting the whole page, by client callback, but the issue comes when I have to populate the Treeview in JavaScript. As far as I know, I have to create all the levels as HTML Table - row/cells, adding my own expand and collapse event handlers, etc., which I want to avoid. I want to be able to use the already available features of the treeview PopulateOnDemand and PopulateNodesFromClient features. That works fine on the Treeview action when I click the rootnode or any subsequent nodes, without any issue, when say the initial input to my webservice call is hardcoded to get the treeview data. My main issue is how do I populate the treeview initially with the entered input and button click on the client side. Some kind of binding the datasource to the Treeview is needed on the client side - whether I do the old traditional way of client callback or using the AJAX like - C# method on the aspx markup itself.

推荐答案

您是否有机会查看以下内容:
跨浏览器(JavaScript/DHTML)TreeView [轻松的DHTML树视图 [
Did you had a chance to look at these:
Cross Browser (JavaScript/DHTML) TreeView[^]
Easy DHTML treeview[^]

There are few more client side treeviews. Go through the CP search and look at them.


这篇关于在客户端填充ASP.NET Treeview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆