维护上一页的更改 [英] Maintaining changes on the previous page

查看:76
本文介绍了维护上一页的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我在asp.net中有一个页面。它最初包含标签,文本框和按钮。用户必须在文本框中输入正确的值,然后单击按钮。按钮事件将显示两个具有更多控件的附加面板。其中一个面板中有一个网格,它将用户带到一个新页面。我在这里做了更多工作,然后想要返回上一页以获得更多工作。问题是,我的页面只显示初始控件而不是修改后的面板。一旦我回到它,我怎么能保持这项工作?



我目前已经尝试过:

1.

Hi everyone. I have a page in asp.net. It initially contains a label, textbox and button. User must input correct value in textbox and then click button. The button event will display two additional panels with more controls. There is a grid in one of these panels and it takes the user to a new page. I do more work here and then want to return to the previous page for more working. Problem is, my page only displays the initial controls and not the modified panels. How can I maintain that work once I come back to it?

I currently have tried:
1.

Response.Redirect("InitialPage.aspx");



2.


2.

Server.Transfer("InitialPage.aspx");



3.


3.

ViewState["UrlRef"] = Request.UrlReferrer; //Saves the Previous page url in ViewState in Page_ Load. 
//if (ViewState["UrlRef"] != null) //Check if the ViewState contains Previous page URL
            //{
            //    Response.Redirect(ViewState["InitialPage.aspx"].ToString());//Redirect to Previous page by retrieving the PreviousPage Url from ViewState.
            //}





但没有成功。还是一样的结果。非常感谢你能给我的任何帮助。提前谢谢:)



But with no success. Still same result. Would really appreciate any help that you can give me. Thank you in advance :)

推荐答案

您可以在新窗口中打开新页面并使用javascript更新开启者,如图所示[这里]?
Can you open new page in new window and update opener using javascript as shown [here]?


从我们的门户网站阅读这篇文章



传递变量在使用QueryString的页面之间 [ ^ ]



http://asp-net-example.blogspot.in/2009/01/aspnet-querystring-example-how-to-use.html [<一个href =http://asp-net-example.blogspot.in/2009/01/aspnet-querystring-example-how-to-use.htmltarget =_ blanktitle =New Window> ^ ]
Read this post from our portal

Passing variables between pages using QueryString[^]

http://asp-net-example.blogspot.in/2009/01/aspnet-querystring-example-how-to-use.html[^]


非常感谢你所有的帮助。 :)



我通过简单地将一个ID从gridview作为会话变量传递到下一页并在我重定向到该页面时再次将其返回来获得我自己的解决方案初始页面。这样做,让我获得了之前所做的所有更改,并显示包含所有更改的页面。 。 。不知道是否有人理解这一点,但这对我有用。
Thank you so much for all your help guys. :)

I got my own solution by simply passing an ID from the gridview as a session variable through to the next page and getting it back again when I redirect to that Initial page. Doing so, made me get all the changes I''ve made before and display the page with all the changes. . .Don''t know if anyone understands this, but it''s working for me.


这篇关于维护上一页的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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