使用向导控件 ASP.NET 时未保存会话变量
我有一个向导控件。当有人单击向导控件中的按钮时,我会自动前进到下一步(而不是强迫他们单击下一步)。但是,这似乎会导致会话状态变量无法保存。我做了一些研究并注意到 Response.Redirect 会进行硬重定向,从而截断页面执行 - 并且您可以添加一个错误参数来防止这种情况......我想知道向导控件是否正在做同样的事情并且如果是这样,我是否也可以为此添加一个参数? 戴夫.
I have a wizard control. When someone clicks a button within the wizard control I automatically advance to the next step (rather than forcing them to click next). However, this seems to cause the session state variable not to be saved. I've done some research and noticed that Response.Redirect does hard redirects that truncate page execution - and that you can add a false parameter to prevent this...what I'm wondering is if the wizard control is doing the same thing and if so, if I can add a parameter to this as well?
Dave.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在我的例子中,它最终与按钮单击控件的启动点有关。例如,如果在向导中我单击了一个按钮,并且它加载了向导中的下一页,它将加载 page_load,然后再在 button_click 事件中设置会话变量。通过将会话变量的使用移到加载过程的后期(在 page_load 之后),button_click 事件将首先触发。
In my instance it ended up having to do with the point at which the button click control launched. e.g., if in the wizard I clicked a button and it loaded the next page in the wizard it would load the page_load before it would set the session variable in the button_click event. by moving the utilization of the session variable later in the loading process (after page_load), the button_click event triggers first.