Click here to Skip to main content
15,904,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Request.Params("ProductID") = DropDownList1.SelectedValue


gives error as "Collection is read only"
plz. help me.
Thanks in advance
Posted

The error is self explanatory. When its said to be read only, it means that you cannot assign values to it. There are tons of explanation on Google about this one if you need further explanation.
 
Share this answer
 
Comments
RakeshMeena 17-Jun-11 0:38am    
Correct! My 5
walterhevedeich 17-Jun-11 1:06am    
Thanks Rakesh.
RaviRanjanKr 17-Jun-11 1:02am    
Nice Answer, My 5+
walterhevedeich 17-Jun-11 1:06am    
Thanks Ravi.
Sergey Alexandrovich Kryukov 17-Jun-11 1:19am    
Sure, a 5.
--SA
Walter is right. Request.Params is a read-only property and is a combined collection of QueryString, form fields, cookies and server variables as mentioned in the MSDN documentation.
Hence if you want to add something to the params collection add it to appropriate collection (Query string, cookies etc.).
 
Share this answer
 
v2
Comments
RaviRanjanKr 17-Jun-11 1:02am    
Nice Answer, My 5+
Sergey Alexandrovich Kryukov 17-Jun-11 1:20am    
Useful extra explanation, my 5.
--SA
Request.Params.Add("ID", itsvalue);

u can do this way
 
Share this answer
 
Comments
RakeshMeena 17-Jun-11 0:41am    
This won't work as the collection is read-only. This might throw "NotSupported" exception.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900