Add QueryString to Every Page?

  • Thread starter Thread starter bdwise
  • Start date Start date
B

bdwise

I generate a querystring on page #1 and want that querystring to stay
on every other page the user chooses, regardless of session or
postback issues. What is a good way to handle that?

Thanks.
 
bdwise,

..Net keeps the query string on every page during post backs for you. So all
you'll have to do is add the query string on to any links on your page and
also tack it on to any Response.Redirects and you're done.

Just add it on as: "mypage.aspx?" & Request.Querystring.ToString

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
But what if I do a Response.Redirect or Server.Transfer from a
codebehind? The querystring would get lost.
 
bdwise,

If you do one of those you'll have to add it on.

Like this:

Response.Redirect("pagetwo.aspx?" & Request.Querystring)

Which would pass the entire query string, from whatever page you are
transferring from, to page two.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
Back
Top