开发者

Keep ASP.NET ViewState without being passed via QueryString

I have a form with its method being "get" that passes the variables and their values to the query string, respectively. However, it also passes the viewstate variable in the query string. Now, I have a very long viewstate value on the given page, and if passed in the query string, the viewstate variable will cause the page to error out, due to "too long of a query string" which happens to also be too long of a url.

I cannot merely remove the viewstate variable - I need it. But I need to pass the viewstate variable along via some method other than get开发者_如何学C when the form is submitted, while the other inputs of the form (the non-hidden inputs) are appended to the query string. Is there any way to accomplish this?


Can you change the method to "post" and then use request.form to get your variables?

Otherwise, you might be able to use the session object... ...or a serializable class object ...or a temp table in a database

Several different options

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜