Request.QueryString.Set() Read Only?

S

Steve

Hi-

I'd like to set values in the QueryString if I detect that a user submits a
bad value, say... ?id=333 where there is no id '333', I would like to set it
to '0' for example.
I tried to use Request.QueryString.Set("id", "0");

it says it is Read Only. How can this be done? Why is there a Set() method
if you can't use it?

Thanks,
Steve
 
M

Mark Fitzpatrick

Steve,
It has a Set method because the querystring is a
NameValueCollection. Inherently, this has a Set method. The querystring
overrides this and disables it. The querystring is basically non-touchable
since you can't alter what is sent from the browser.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
G

Guest

I have capture the query string like

qs=request.querystring().tostring

and then rebuilt the query string with modified values
and response.redirect(url & qs) to it
 
K

Kevin Spencer

You will also notice that when you make any change to "qs" that it doesn't
change the Request.QueryString value.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,019
Latest member
RoxannaSta

Latest Threads

Top