How to update an updatepanel using regular links?
Posted on 2007-12-04
I have been breaking my brains over this one. The client we have really wants to use AJAX, and I say good for him, however there are some things that are a little harder to acchieve for this client.
For a part of what I am building we need to show the products they have, it's a shop that sells every kind of battery you can imagine. Normally I'd be thinking in the likes of repeaters or possibly a gridview to display the lists of products he has. However, the system that is running on the background requires some special concideration. The way I need to get the data out of there is done in their own special way and always returns me a so called SumatraVT.ResultSet, if I'd be in luck, I'd be able to bind that to the repeater, but...I am NOT in luck. ;)
It turned out I had to write out the entire thing from codebehind, so instead i created two literals inside the updatepanel. One to hold the products for the selected page, one to hold the pagination. I also added buttons to make sure I could jump from page to page. That works fine, but it does get confusing when you can see on which page you are by seeing the pagenumber below, but you can't click the link.
Now if this would have been without AJAX, that would have been easy for me, I'd just add a querystring value to tell the page to which pagenumber I'd want to go. Easy peasy right? But with AJAX and an updatepanel...I am at a loss. For all I know I need to be able to execute a server side function to make sure the page gets updated, but I cannot trigger a postback using an ordinary link, nor can I add a function that needs to get executed WHEN I click that link.
I'll admit I've been working on this for far to long which has clowded my mind a bit so I am not seeing any other solutions either at this point in time. Is there anyone out there that could solve my problem so I could give the pagination in a way that would be logical to use?
Thanks in advance. Just ask if you need to see any of my code. Although it really is a mess if you don't know this Sumatra system. (I've been building workaround upon workaround)