UpdatePanel会话状态 [英] UpdatePanel sessionstate

查看:92
本文介绍了UpdatePanel会话状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我使用的是VS 2005和aspx.vb.我有一个带有一些文本框的更新面板。因此,当用户输入数据时,它会根据该数据从sql表中过滤掉并填充更新面板下方的gridview。 gridview有一个编辑选项。


当用户点击编辑按钮时,iam重定向到另一个页面,如下所示,在selectedIndexchanged中

Hallo everyone,

I am using a VS 2005 and aspx.vb. i have a updatepanel with some textbox. So when the user the enters the data it filter''s from sql table according to that and fill the gridview below the update panel. The gridview has a edit option.

Now iam redirecting to another page as shown below in the selectedIndexchanged when the user click the edit button

展开 | 选择 | Wrap | 行号

推荐答案

当你返回页面时,会话还没有结束。

你的ViewState有。


ViewState包含页面上所有ASP.NET控件的状态信息。


这意味着如果您在DropDownList中选择了一个值,则所选值将存储在ViewState中...同样,如果用户在TextBox中输入了文本,则文本为存储在ViewState中。


这就是ASP.NET控件如何记住它们对服务器的请求之间的状态。


没有ViewState用户输入TextBox的文本,当用户使浏览器向服务器发出请求(回发)时,用户在DropDownList中选择的项目将丢失...除非您手动设置每个页面请求的控件状态。


无论如何,我的观点是你可以将用户选择的索引存储到Session中。


会话不受约束特定页面。

会话存在于服务器上,为您提供了一种在页面之间传递信息的方式。


所以不要:
Session has not ended when you return to the page.
Your ViewState has.

ViewState contains the State information for all of the ASP.NET controls on the page.

This means that if you have selected a value in a DropDownList, the selected value is stored in ViewState...likewise, if the user has entered text into a TextBox, the text is stored in ViewState.

This is how ASP.NET controls remember what their state is between requests made to the server.

Without ViewState the text the user entered into the TextBox and the item the user selected in the DropDownList would be lost when the user causes the browser to make a request to the server (postback)...unless you manually set the state of the controls every page request.

Anyways, my point here is that you can store the index that the user selected into Session.

Session is not bound to a particular page.
Session exists on the server and provides you with a way to pass information between pages.

So instead of having:
展开 | 选择 | 换行 | 行号


Hallo Frinny,


感谢您的回复。实际上问题不在于响应重定向我认为因为gvliste(gridview)没什么可存储的。我有一个updatepanel,有3个文本框供用户输入值。当用户在gridview中输入值时,它会根据用户输入进行过滤并显示。


或者这可能是问题吗?我有一个Page_Init我正在寻找Http.context.user.identity.name并像这样填写
Hallo Frinny,

Thank you for your reply. Actaully the problem not with the response redirect i think because the gvliste(gridview) nothing to store. I have a updatepanel which have 3 text box for the user to enter the value. When the user enter the value in the gridview it''s filter according to the user input and displayed.

Or is this could be the problem ?.. I have a Page_Init in that i looking for the Http.context.user.identity.name and filling in like this
展开 | 选择 | Wrap | 行号


听起来像你想要的将所选行的详细信息传递给下一页。

为什么不创建一个类或结构来在Session中保存这些详细信息,以便您可以在下一页访问它们。

因此,当用户选择一行时,从该行获取所有信息以使用数据填充Object(自定义类)。然后将此Object存储在Session中,以便您可以在下一页访问它....


-Frinny
It sounds like you want to pass the details of the row selected to the next page.
Why don''t you just create a class or structure to hold these details in Session so that you can access them on the next page.

So when the user selects a row, grab all of the information from that row to populate the Object (of the custom class) with the data..then store this Object in Session so that you can access it on the next page....


-Frinny


这篇关于UpdatePanel会话状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆