Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How can I fetch data from database using jquery with paging along with asp server controls in it? I tried this code.But how could I add server controls in it as I need it to add the encrypted hyperlinks to it based on user permissions.

What I have tried:

https://www.aspsnippets.com/Articles/Display-Large-Amount-of-Data-in-GridView-with-Search-functionality-in-ASPNet-using-jQuery.aspx
Posted
Updated 10-Jul-18 23:33pm
Comments
F-ES Sitecore 11-Jul-18 4:48am    
Server controls can't be created via javascript, if you are creating form elements via javascript you'll need to come up with a way of making your server code run from those basic html controls rather than server controls.

1 solution

A Data Representation control such as GridView is binded at the server, thus adding controls within it should be done at the server - otherwise if you add/inject an element at the client (JavaScript) they will be gone when it postbacks. You may want to use a client-side Grid that allows you to do what you want. The idea is to grab all the records from a service call (assuming you are using AJAX to populate your grid) and then search the records from it and then rebuild your client-side GridView along with hyperlink elements that you want to add.

One example is using bootstrap datatables: Bootstrap Table With Sorting, Searching and Paging using dataTable.js (Responsive)[^]

You can see the live demo here: A demo of table with pagination and search options[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900