Three ways ... server-side redirection, LinkButton and a client button or link.
You can redirect your button's event handler to a location using the query string ...
Response.Redirect("myPage.aspx?id=" + myId.toString(), true);
You can display the button as LinkButton and set the url ...
LinkButton myLinkButton = new LinkButton("myPage.aspx?id=" + myId.toString(), true);
Or you can display the button as a client-side link - this is what I do when using Repeater elements ...
<a href='myPage.aspx?id=<%# Eval("myID") %>'>Link</a>
I prefer the latter method, especially when I need a whole bunch of links.
By the way, this is a KISS application - all you need is a regular old link, you do not need to jump through hoops on the server side to create a link with a request in it. With regular HTML client code, whenever possible, you can simply save ASP.Net. I do not see enough of this technique in the wild.
source share