从通过形式GET查询字符串中传送preventing ASP.NET视图状态 [英] Preventing ASP.NET viewstate from being transmitted in querystring via form GET

查看:124
本文介绍了从通过形式GET查询字符串中传送preventing ASP.NET视图状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我相信我已经停用​​所有的控制以及页面本身的视图状态,但查询字符串仍然包含__VIEWSTATE和__eventvalidation参数。

I believe I have disabled the view state on all controls as well as the page itself, but the querystring still contains the __viewstate and __eventvalidation parameters.

什么检查和/或更改任何想法?有什么我可能不知道的视图状态(很有可能),导致该视图状态的形式GET方法进行传输?

Any ideas on what to check and/or change? Is there something I may not know about viewstate (very likely) that is causing the view state to be transmitted in the form GET method?

谢谢,
凯文

编辑:

我使用GET方法,因为我想表单结果要能待加书签,链接等,仅仅是因为表单数据不通过URL发送这是不可能的帖子。

I am using the GET method because I would like the form results to be able to be bookmarked, linked, etc. This is not possible with Post simply because the form data isn't transmitted via the URL.

和我preFER未显示只是为了美观的原因视图状态/ eventvalidation。

And I prefer the viewstate/eventvalidation not shown simply for aesthetic reasons.

推荐答案

从表单标签取下 =服务器属性将有效地删除隐藏视图状态和eventvalidation领域。但你不能在网页上使用的服务器控件,所以我怀疑这就是你想要做的事。

Removing the runat="server" attribute from the form tag will effectively remove the hidden viewstate and eventvalidation fields. But then you can't use server controls on the page, so I doubt that's what you want to do.

您确定__VIEWSTATE和__eventvalidation域出现在你的查询字符串的??这听起来确实有点怪怪的。

Are you sure the __viewstate and __eventvalidation fields appear in your querystring?? That does sound a bit strange.

发表一些code和告诉我们为什么要删除摆在首位的隐藏字段。如果您在页面级禁用视图状态,在隐藏字段中的值应保持相对小的...

Post some code and tell us why you want to remove the hidden fields in the first place. If you disable viewstate on a page-level, the values in the hidden fields should remain relatively small...

这篇关于从通过形式GET查询字符串中传送preventing ASP.NET视图状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆