Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Url editing on postback

Tags:

c#

url

asp.net

Suppose I am having an url like: http://localhost:4647/Project/MyList.aspx.

On postback I want add some parameter(pageNo=4) to the url like: http://localhost:4647/Project/MyList.aspx?pageNo=4

Can I add "pageNo=4" to the url on postback as shown above? If yes please tell me how to do this.

like image 953
ANP Avatar asked Feb 25 '26 07:02

ANP


1 Answers

You cannot change the client's URL from server-side code without redirecting.

Clients don't normally read URLs from server responses. (An HTTP response doesn't even contain the URL, except when redirecting; see here and here for details.)

Having said that, redirecting after posting is a very good idea anyway - consider using that technique.

like image 75
Jeff Sternal Avatar answered Feb 27 '26 19:02

Jeff Sternal



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!