2014年7月13日 星期日

[RESOLVED] How to bind DataList control within Web method in asp.net


Hi,


Can anyone help me in how to bind values to the datalist with in web method.


thanks



Hi,


That may not be possible. WebMethod or PageMethod are used to inform server or get data only


but not to create asp.net control or update it.


What u can do is, call WebMethod get DataSet and fill DataList at serverside itself.


http://www.aspdotnet-suresh.com/2011/05/aspnet-web-service-or-creating-and.html


or fill it by Ajax,


http://www.aspsnippets.com/Articles/Populate-ASPNet-DataList-by-binding-DataSet-Client-Side-using-jQuery-AJAX.aspx




Yes as raju has explained that web-methods are kind of Web-API calls and only service raw data not the server-side control binding etc. So, instead use jQuery based data control along with your web-methods.


Thanks 


沒有留言:

張貼留言