tags:

views:

21

answers:

2

Good day

I need to change a value in Request.Params["MyCustomKey"]

Is any way to do it?

Thanks in advance

+1  A: 

Usually you just don't need to alter Request.Params value. Why do you need that?

Edit:

I think the correct way to do this is pass ID separately of the StringID, so you will be able to get your 100 value from Request without parsing link button's text. Who forms String ID 100 text?

Andrew Bezzub
Thank you for an answer. I use linkbutton and linkbutton's text passed as a Request.Params["StringID"] value which is i.e. "String ID 100", but, then, I need only "100" to use otherwise I would have to parse it in 6 places in the client's code, so, therefore, I would like to alter it.
Updated answer.
Andrew Bezzub
Also, it it's good practice to assign Request.Params["whatever"] to its own in-scope variable for consumption instead of using the Request object. I'm sure your other code does not need to see the whole Request object.
Scott
A: 

I do not know your application architecture, but why not writing a static method for parsing or even a extension method? You shouldn't change the values in Request.Params

Dennis