Is there a size limit that the HTML.Hidden can take ?I have the following code, which works when i only put ViewData[“key”]=”12345″ but when the “12345 is too much data the htmlfield is empty.
@Html.Hidden("hid" + param.Parameter.Name, ViewData["hid"+param.Parameter.Name])
And when I add the ViewData[“hid”+param.Parameter.Name] in javascript function to alert the values, the entire string is there.
kind regards
If you are using HTTP POST verb to submit the form the limit is controlled by the
maxRequestLengthattribute of the<httpRuntime>element in your web.config. The default value is 4096 KB:Example:
successfully uploads all the 40K
ato the server.On the other hand if you are using an HTTP GET verb to submit the form then, since the values are sent in the query string, there will be a limit. This limit will vary across different browsers. IIRC it was around 4K in IE.