System.NotSupportedException: Collection is read-only.
-
Hi, I have an httpmodule which am using to modify the value of my querystring parameter. What i did was to encrypt the value of the querystring parameter, am decrypting the parameter inside the BeginRequest event so my code behinde will have access to the plaintext. the issue is when retrieve the parameter into a NameValueCollection and try to use the Set method to update the parameter value i get this error. System.NotSupportedException: Collection is read-only. but i can't access the IsReadOnly property of the class. how do i update the decrypted parameter value to the querystring so i can have the plaintext in my code behind. Thanks in advance Lookman
-
Hi, I have an httpmodule which am using to modify the value of my querystring parameter. What i did was to encrypt the value of the querystring parameter, am decrypting the parameter inside the BeginRequest event so my code behinde will have access to the plaintext. the issue is when retrieve the parameter into a NameValueCollection and try to use the Set method to update the parameter value i get this error. System.NotSupportedException: Collection is read-only. but i can't access the IsReadOnly property of the class. how do i update the decrypted parameter value to the querystring so i can have the plaintext in my code behind. Thanks in advance Lookman
AFAIK, query string collection is read only. So you can't assign anything to there. Instead ,you can rewrite the path with the new values required. Use
Context.RewritePath
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
AFAIK, query string collection is read only. So you can't assign anything to there. Instead ,you can rewrite the path with the new values required. Use
Context.RewritePath
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
Set() won't work because the whole collection is read only. Your best bet is rewrite the path.
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions