asp.net - Load listview with Jquery postback -
i new jquery , want build listview created codebehind function. , want jquery function without page postback. implement updatepanel functionality without using updatepanel.
use jquery load call server page returns markup listview/ table
//inlcude jquery library here <div id="mydiv"></div> <script type="text/javascript"> $(function(){ //this code execute once dom ready $("#mydiv").load("myserverpage.aspx"); }); </script> and in myserverpage.aspx, can return html markup shown in main page.
protected void page_load(object sender, eventargs e) { stringbuilder stritems = new stringbuilder(); stritems.append("<table>"); //you can replace below dummy each loop code //to read data database. for(int i=0;i<10;i++) { stritems.append("<tr><td>"+i.tostring()+"</td><td>i awesome</td></tr>"); } stritems.append("</table>"); response.write(stritems.tostring()); } if simple html markup, use ashx handler instead of aspx page.
the load function load markup returning myserver.aspx page. wont have events listview server control.
Comments
Post a Comment