1

我已经将视图状态存储在会话中。但是,当我使用更新面板时,我仍然看到:

|0|hiddenField|_ EVENTTARGET||0|hiddenField| _EVENTARGUMENT||0|hiddenField|_ LASTFOCUS||72|hiddenField| _VIEWSTATE|/wEPZwUPOGQwMTViZDAyYzljM2RiDkOzqPgrsrLq7oLjMrtEqvksOkereJ+iwT7JWm4o3eY=|1|hiddenField|_ SCROLLPOSITIONX|0|1|hiddenField|_SCROLLPOSITIONY|0|2524|hiddenField|__EVENTVALIDATION|/wEdAHT9Fws9F+QU02vyHw9EtdeObLsgjLvX39DC4H8vBJFsyG18cELKaPXq+6Ahww6b1rU+8PzArOjCJUc2STBQ8LpyrHZEzuzo3X7y36pxjtFPwEmlgfvDnB/DNXrQtx2v9SFwA6EUH25J8efaI9V++QjV3oYJ3CPuCO4rknM0UDU/Giw7O8WNpkhgFBXVsNXctDwPxcu09HF7wSzZJLw+yDLL27KCQmMvwyeQidE5tg2IjJwVkoU7oeLVX9C9RJWJzOSAE0IYtgz1LUDFnEzz2hYOu5ayAaskN4ApdAYd5uRg6K90gthxiirKGv+NQoPCw4Y6j7rA2ev411USg9tq7NB9PWYHwL5OwnZ+EXR/NJSLlRHPRrtnXSvGItKU8f0Dp34XG1CYjecxpmI5DuS/QVB3TlY541cQjTzcCv/HsuxlIciiPNCUviC1rvOBSWAA5xRgeRoRdmrXcedawNvUNZNX9qlIl95cg1FFB3mx2hy79XB+FEw3T7oc//ZDu3Y2K2NaCCK9+JQB0ysMN3aBxKawLkwRYSkH8judvo71vrM731VSHTSByvJ+f9qJ+bkVEjIfqddGEVOgyU0snyHEF8GKyF3iWsXTzAe9Fc2I41sQQfNQ1Mb/i5HmDqpAsKH4S1tt96XgwmzKUAHVyC9YllJNz7KbvuAn9E45Xu +8y2sy4PL+ocjVp1LzZqKm1zxDydsyYEJykODvuiTL0ZFyUUlFqCLvWZs1Tv/gcwhV/SX1YwsxN6djvw+U8ixFqIj/WKymYeC+uRep3FgV5RZvwh3ZZWX+Uyqb4NW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g3Mb6oV1O581CKClBM3IGiMNVGZ5GAixwtnbQZwA5eerBurSYQ79Cp5UExRubalAdi7EIXdznejVWgTEmL6oF9xSVXPB/4B7/Odm4FcDGaCaD7uEjgTdyDCeVA/OW2e3hF+dPX92E9a1/ItywkONZRylQmQ5LUb5NE8LVejlFSluTqPTtcGUZ6E1fMIFtKja0pvPJGc+iRhDN2HMOIlGqBVGYhkX1NOBuedASsY0HLFXnvr2L/aU+kcXsjFrKM74NLrtGQzffpFomEjZOvHZ34GMwGxvjaj4+6FI/HQbQlCNJnpwmQGauXnffaIUBtOesA1gpJYB//Yy/J4tMSNePfi6S06BIWWH1lWdRtjzLndYgb/aBBtPpuERDmR13pBLUCNjFzYVhMteyaW6iNMyQ4vhimTHpfJmNetj1a8qL+AZ7mflGfEdlBhM5oPVUOYeqPQD+nAlHmqmGopXtSAYNb/zIUrYdEKXomNrF2x0gU3Z8CovtY31qvaFstoyKBokBco1V1RNAmbCIC7qcAV5rT+5znsrbWy9K+ltbeK18p5o22ntmveymm7IifzgKdI9Pw9NgqbV/e7Wvj2qjIRH7MVyItXHkfOjP24GZ8IFFCFcT9D/bi0kSfSe36Xk89p1eJrsuNNxL /QRqaq|0|asyncPostBackControlIDs|||0|postBackControlIDs|||102|updatePanelIDs||tctl00$Body$updIGrp,,tctl00$Body$updITyp,,tctl00$Body$updRpt,,tctl00$Body$updSrch,,tctl00$Body$updDoc, |0|childUpdatePanelIDs|||57|panelsToRefreshIDs||ctl00$Body$updRpt,,ctl00$Body$updSrch,,ctl00$Body$updDoc,|2|asyncPostBackTimeout||90|0|formAction|||39|scriptStartupBlock| ScriptContentNoTags|removeLastColumn('ctl00_Body_grvDocs');|208|scriptStartupBlock|ScriptContentNoTags|Sys.Application.add_init(function() { $create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_Body_updRpt","displayAfter":0, “动态布局”:假},空,空,$get(“ctl00_Body_ctl07”));tctl00$Body$updDoc,|0|childUpdatePanelIDs|||57|panelsToRefreshIDs||ctl00$Body$updRpt,,ctl00$Body$updSrch,,ctl00$Body$updDoc,|2|asyncPostBackTimeout||90|0|formAction| ||39|scriptStartupBlock|ScriptContentNoTags|removeLastColumn('ctl00_Body_grvDocs');|208|scriptStartupBlock|ScriptContentNoTags|Sys.Application.add_init(function() { $create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_Body_updRpt", "displayAfter":0,"dynamicLayout":false}, null, null, $get("ctl00_Body_ctl07"));tctl00$Body$updDoc,|0|childUpdatePanelIDs|||57|panelsToRefreshIDs||ctl00$Body$updRpt,,ctl00$Body$updSrch,,ctl00$Body$updDoc,|2|asyncPostBackTimeout||90|0|formAction| ||39|scriptStartupBlock|ScriptContentNoTags|removeLastColumn('ctl00_Body_grvDocs');|208|scriptStartupBlock|ScriptContentNoTags|Sys.Application.add_init(function() { $create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_Body_updRpt", "displayAfter":0,"dynamicLayout":false}, null, null, $get("ctl00_Body_ctl07"));Application.add_init(function() { $create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_Body_updRpt","displayAfter":0,"dynamicLayout":false}, null, null, $get("ctl00_Body_ctl07") );Application.add_init(function() { $create(Sys.UI._UpdateProgress, {"associatedUpdatePanelId":"ctl00_Body_updRpt","displayAfter":0,"dynamicLayout":false}, null, null, $get("ctl00_Body_ctl07") );

有什么办法可以防止它被发送作为回应?

4

2 回答 2

1

从stackoverflow中提取:

__VIEWSTATE 字段也用于存储控制状态,它不是可选的。此外,如果我没记错的话,视图状态中包含的信息用于验证回发(并且启用了验证,这是默认设置)。因此,只要您拥有带有 runat="server" 的表单,您就会拥有一个 viewstate 字段。但是,如果禁用所有视图状态,您应该会注意到字段大小要小得多。

顺便说一句,有一些技巧可以删除视图状态。检查以下帖子:

使用 Regex 覆盖 Render 并剥离 ViewState。

于 2013-05-03T06:47:49.153 回答
1

在 UpdatePanel 上设置“EnableViewState=false”。这将禁用其中包含的所有子控件的 ViewState。或者,如果您需要更精细的方法,您也可以逐个控件禁用 ViewState。

于 2013-05-06T20:00:29.963 回答