简体   繁体   English

回发后保留PreviousPage信息

[英]Retaining PreviousPage information after postback

I'm using the asp.net PreviousPage functionality and cross-page postback. 我正在使用asp.net PreviousPage功能和跨页回发。 The problem i'm running into is that if I have any postbacks on my page, the PreviousPage information seems to be lost. 我遇到的问题是,如果我的页面上有任何回发,则PreviousPage信息似乎丢失了。 I don't want to put it in ViewState because that will be quite large. 我不想将其放在ViewState中,因为那会很大。 I've thought about Session, but I don't want the data to persist after i've moved on to another page, and I really don't like the idea of putting code in all my other pages to delete old session variables. 我考虑过Session,但是我不希望在移至另一页后数据仍然存在,而且我真的不喜欢将代码放在其他所有页中以删除旧的Session变量的想法。

What methods do you use to retain this sort of information that was passed in via cross-page postback? 您使用什么方法来保留通过跨页面回发传递的此类信息?

UPDATE: 更新:

Most of the answers to questions raised about refreshing the page mention using Response.Redirect. 有关使用Response.Redirect刷新页面所提出问题的大多数答案。 I can't use this because it will cause a Get rather than reposting the informaiton that was posted to the page via cross-page postback, resulting in a loss of this information and preventing me from pupulating my controls with the selection criteria of the previous page. 我不能使用它,因为它将导致获取而不是重新发布通过跨页面回发发布到页面的信息,从而导致该信息丢失并阻止我使用上一个的选择标准来对控件进行伪造页。

I need to update the data in the grid while retaining the postback information. 我需要在保留回发信息的同时更新网格中的数据。 I thought about using AJAX, but that's not really an acceptable solution right now per customer requirements. 我曾考虑过使用AJAX,但是根据客户的需求,这实际上不是一个可以接受的解决方案。 I need to click a button and refresh the page as if it was newly posted, and i don't really see a way to re-submit a postback short of F5 and then clicking the dialog to accept reposting of data. 我需要单击一个按钮并刷新页面,就好像它是新发布的一样,并且我真的没有找到一种方法来重新提交少于F5的回发,然后单击对话框以接受重新发布数据。

在初始页面加载时,将上一页的值存储在ViewState中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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