Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How to change URL ID using query string and onbuttonclick?

$
0
0

Hi,

I am using query string to pass values from one page to another. Basically it is a list with images and when you click image it opens same image larger and with more information.

What I want to do is add Previous and Next buttons on the page when individual image opens and instead of going back to the list you can browse through with next and previous buttons. I know what query string to use but I am struggling with assigning that query string to Previous and Next button onbuttonclick even.

This is what I want to do. This is my query string when you open individual image page where I have next and previous buttons:

http://www.mydomain.com/viewitem.aspx?ID=5041&SectorID=2

I want on next button onbuttonclick event to call response.redirect (Response.Redirect("~/viewitem.aspx?ID=5041&SectorID=2") and increase ONLY ID by one and sectorID to remain the same (opposite on previous button onbuttonclick). I also would like to make sure that if ID does not belong to SectorID anymore next or previous buttons disappears. Want to make sure it does not show wrong item or stops browsing through if there are no more items in this sector.

Appreciate your help.


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>