One Clarification

  • Thread starter Thread starter ss
  • Start date Start date
S

ss

I have a doubt.
I have 2 webform W1, W2 with a Button control B1, B2
respectively.
In From W1 on click of button B1, i redirect response to
WebForm W2 along with a querystring value. [w2.aspx?test=c]

Now, on W2, i get this value using Response.Queystring...
no issues. The issue comes, when i post W2 by clicking on
Button B2. And the issues is that i can still get the
querystring value c even though i used "Post" method.

To this day i used to think that querystring should be
cleared if the form is posted using "Post". Am i wrong?
Is it a dot net implementation only? To preserver Query
String?
 
ss,

Yes, this is a new feature of .net

It used to take a lot of extra coding to keep persisting querystring values
so microsoft built it in for us.

Sincerely,

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
ASP.Net uses WebForms, which are a special type of form that has server-side
event handlers. The event handlers are triggered by a PostBack, which means
that the form submits back to itself. In order to preserve the state of the
WebForm between PostBacks, the QueryString (as well as all other elements of
the WebForm) must also be retained as it was originally. This is done on the
server.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
 
Back
Top