I have a text string value that I would like to save from one web page to another without using query strings or session / presentation states. I am trying to get ASP http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hiddenfield.aspx "> HiddenField to transfer information from one web form to different .All examples of hidden field management I saw is to save round trips from client to server for the same form.Is there a way for the form to access ASP controls (and their values) from a previously created form? Or the original form is simply deleted in memory by then when does the second form execute its OnLoad Method ?
- . , Server.Transfer, - . " ", .
http://mysite.com/Page1.aspx, , Server.Transfer( "Page2.aspx" ). Page2.aspx , URL- Page1.aspx, /.
Server.Transfer - , , , , ; Cookie, QueryString, Session, Database - .
Response.Redirect. :
if (Page.PreviousPage != null) { TextBox SourceTextBox = (TextBox)Page.PreviousPage.FindControl("TextBox1"); if (SourceTextBox != null) { Label1.Text = SourceTextBox.Text; } }
, Server.Transfer:
firstpage.aspx:
protected void Page_Load(object sender, EventArgs e) { Server.Transfer("~/secondpage.aspx"); }
secondpage.aspx:
protected void Page_Load(object sender, EventArgs e) { Page previousPage = (Page) HttpContext.Current.PreviousHandler; Label previousPageControl = (Label) previousPage.FindControl("theLabel"); label.Text =previousPageControl.Text; }
, , .
, Response.Redirect() Location: HTTP .
HTTP , , .
.
, , , ( , , , 2
, Response.Redirect . , . , , .
, ?
Source: https://habr.com/ru/post/1698018/More articles:How to use vxWorks debugging tool to perform kernel kernel debugging? - vxworksRapid prototyping for embedded systems - embeddedBest practices for throwing exceptions from SQL in C # - c #How to use the Rails helper link_to RESTfully in this situation? - restConfiguring Tomcat 6 to support Russian cp1251 encoding - javaUnderstanding Lists in an Open Office Spreadsheet - list-comprehensionProblem opening berkeley db in python - pythonhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1698021/java-swing-client-data-access-to-remote-database-ibatis&usg=ALkJrhhcGxDsPthzgaQC0haNE01rMEMGNQHow to include RSS feed in RSS? - pythonVisualBasic Month function malfunction - vb.netAll Articles