How to pass the whole querystring from one page to another page textbox using asp.net?

1.7k views Asked by At

I have two webform ....

Default.aspx & Default2.aspx

I want In Default.aspx on button click event it passes the whole query string to Default2.aspx textbox ?

How to do that uisng vb.net ...

if the query string generated from default.aspx on button click event is http://www.abcd.com?name=sumit&age=23&class=10&role=monitor

then on Default 2 the textbox2 text will be ...

http://www.abcd.com?name=sumit&age=23&class=10&role=monitor

1

There are 1 answers

0
ScottE On BEST ANSWER

Use Server.Transfer("default2.aspx",True)

Where the 2nd parameter preserves the querystring / form collections.

An asp:button also has a PostBackUrl property that you can make use of.