<body>
<form name="aspnetForm" method="post" action="Index.aspx" id="aspnetForm">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTEwOTgxMzA1MjkPZBYCZg9kFgICAw9kFgICAw9kFg4CAQ8WAh4LXyFJdGVtQ291bnQCBhYMZg9kFgJmDxUEEDk2NDZCM0JBQjgxNzM2RjYtL0F0dGFjaG1lbnRzL1hpbmcvMjAwOS85XDIwMDk5MTgxMzU5MzE4NTEuSlBHAABkAgEPZBYCZg8VBBA4NUMzQTRFMUE5QTQ2ODQ2Ey9BdHRhY2htZW50cy9uby5naWYABuW5v+S4nGQCAg9kFgJmDxUEIDREMDc3MUEyOTAxRjg3NzcyNzFCNDIyMDVDQjY5OTg0Ey9BdHRhY2htZW50cy9uby5naWYABuW5v+S4nGQCAw9kFgJmDxUEIENCRDVBODE2ODE1QkY3Nzg1M0UwNDlDQTNFOTJDRDhGEy9BdHRhY2htZW50cy9uby5naWYABuW5v+S4nGQCBA9kFgJmDxUEEDdERkMyMERCMzMyRkIzMkQTL0F0dGFjaG1lbnRzL25vLmdpZgAG5bm/5LicZAIFD2QWAmYPFQQgNzg1MTZDRDU0Mzc1RjhEMzlFQ0RGMjEzMDJDNkFBMEYTL0F0dGFjaG1lbnRzL25vLmdpZgIyNQblub/kuJxkAgMPFgIfAAIGFgxmD2QWAmYPFQUgODdBOEMwMUU2ODJDMDUyRTBCNDFGOTU4NzM1MjFGMTYGeHVhLi4uIDg3QThDMDFFNjgyQzA1MkUwQjQxRjk1ODczNTIxRjE2GeeIseS9oOS4gOS4h+W5tO+8gXNkZnMuLi4KMjAwOS0xMC0yMWQCAQ9kFgJmDxUFEDVGNUYzODkyM0NCODJGRTcGbG9wLi4uEDVGNUYzODkyM0NCODJGRTcZ54ix5L2g5LiA5LiH5bm077yBc2Rmcy4uLgoyMDA5LTEwLTIxZAICD2QWAmYPFQUgNkY2RDE3ODY1QTg1MzNDMzZDNUZERjAwMzBERTI2OTAGNTAzLi4uIDZGNk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zM0EwN0ZFMzlEQzNEMkFFOENCQzRDOUUwMzRDRjhDD+i/t+WkseeahOezlee+imQCBA9kFgJmDxUFAzE1NRA3QzNCMTcxNTRGQUQ4MDQ5HeeIseWlveOAgemXsumSseOAgeaXtumXtC0tLi4uEDdDM0IxNzE1NEZBRDgwNDkM5Lq65Zyo5aSp5ravZAIFD2QWAmYPFQUDMTk1EDhFM0NBQUUyNzBDQjNBQ0Uh5bqV5aaG5bu25Ly45oyH5bCW5ben5aaZ5Yi35Ye6Li4uEDhFM0NBQUUyNzBDQjNBQ0UM6ZqP6aOO55qE54ixZAIGD2QWAmYPFQUDMjAxEDY2NUQxOTVCOTUwMzFEMzgh5aWz5Lq65aSW6YGH6Ieq5pyJ5LiA5aWX5r2c6KeELi4uEDY2NUQxOTVCOTUwMzFEMzgM6Zuo5Lit546r55GwZAIHD2QWAmYPFQUDMjAzIEY5MDA2RkMzOEQ2NzA3N0NCNUZBREJEOEE3QzlDMzZEIeS9oOeci+i/h+eClueJm+iCieeahOacgOmrmOWigy4uLiBGOTAwNkZDMzhENjcwNzdDQjVGQURCRDhBN0M5QzM2RAzku
这个是.net保持页面状态的一种机制
你去查查VIEWSTATE
可以关闭VIEWSTATE,具体的方法我也不太清楚!
VIEWSTATE,页面视图
用来保存页面状态的,主要是供服务器控件使用的。
用WEBFORM就是这样
Asp.NET中服务器端的控件都是依据页面中的form来生成html控件的,所以无论你使用还是不使用服务器端控件,aspx页面默认都会给你放一个form的,其次就是这个隐藏于input,主要是用户保存aspx页面中的viewstate的
这个最好让老赵来回答一下,呵呵
正是这些东西,使得.net 的客户端控件非常容易使用,不用处理http get post,但也影响了性能和代码美观。
现在的asp.net mvc就没有这样的代码了。
这个东西是: VIEWSTATE 用于保持当前状态的。
如:我们经常会这样写代码:
if(!page.Ispostback)
{
Textboxt.Text="sss";
gridview.datasource="";
}
像这种带数据的控件在 post回发的时候其实没有给他绑定数据的是吧,但是其明明就有数据,其实在页面加载周期page_load()事件之前 有个loadviewstate(),这个东东隐藏了对页面的空间数据恢复的作用。
1.如果你的页面没有post,完全禁掉就行了
2.如果表单比较多,这东西还是很好的,没有搞明白禁用可能会出些乱子~~~