且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在使用EnableviewState ="true"时感到困惑.

更新时间:2023-11-04 14:16:58

ViewState仅在您停留在同一页面上时可用.如果要在页面之间导航,则需要查看其他保留信息的方法:

1.会话状态: http://msdn.microsoft.com/en-us/library/ms178581.aspx [ ^ ]

2. QueryString:使用QueryString在页面之间传递变量 [
ViewState is only available if you stay on the same page. If you''re navigating between pages, you''ll need to look at other methods of persisting the information:

1. Session State: http://msdn.microsoft.com/en-us/library/ms178581.aspx[^]

2. QueryString: Passing variables between pages using QueryString[^]

If the information is in any way more complex than just a couple of primitive values (integer, string etc) I''d use Session State. It''ll let you persist complex objects across requests for different pages.