简体   繁体   中英

Save viewstate in a user control

I've problem with a user control in asp.net

I've created a usercontrol that save a value in the viewstate, now the problem is that on postback the viewstate loses this value

Why? Should I do something in particular?

If necessary tonight I'll load some code.

可能是因为在父控件上禁用了ViewState,请检查您是否在任何地方都没有EnableViewState=false ,因为这会阻止您检索页面回发中的值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM