Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET: Bind Repeater using jQuery?

I have a Repeater control that I bind server-side. It repeats a series of divs, and does so with no problem. I have some buttons that I use to sort the repeater (newest, highest ranked, random) and this works the way it should.

I would like to improve my user experience by making the buttons sort the divs using Ajax/jQuery somehow so that there is no page postback and the user does not lose his/her spot on the page.

Is there a way to use jQuery to access server-side code like this, or use Ajax to re-bind a server-side control?

Thanks... if I need to list more details, please let me know!

EDIT I'm aware of UpdatePanels, but I would prefer not to use them if I don't have to.

like image 801
Jason Avatar asked Dec 20 '25 02:12

Jason


1 Answers

Have you considered moving the Repeater's functionality to the client-side?

Doing it that way, functionality like paging and sorting is not very difficult to add. In fact, you can lean on the framework pretty heavily by using ADO.NET data services as the service layer.

like image 155
Dave Ward Avatar answered Dec 22 '25 19:12

Dave Ward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!