开发者

Failed to load viewstate in asp.net

I got this problem with asp.net:

Failed to load viewstate. The cont开发者_运维技巧rol tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request. For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.

Any tips please?


You need to specify a machine key in your web.config. This typically happens when the app get recycled and ASP.Net generates new keys to encrypt/decrypt session state. If you're running a web garden/farm you'll also need to have the same keys on each of the servers. Eg in the system.web section of the web.config file

 <machineKey validationKey="6D1873D8ABE57E15252C4C6A9164F0A1C3E68FBAD8C2F09AEFF178A1269E11FCA4ACAAA628EFAA33FF4C922D638213C63CA6AF76EAEB779D37481CE4ADBC1E7A" decryptionKey="8EA3075B2BB30B0A121BFD283CC78012B83C8D741B846495" validation="SHA1"/>

Google up on this and there are sites that can randomly generate more keys for you.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜