I have a hidden field on the main page. I set its value on the child page via JavaScript. When I click the link on this child page, it redirects to another page. Now I want to get the value of the hidden field on this new child page. But value is lost (obviously). How can I save this value.
Thank you all for your help in advance.
You can pass the value in the query string as follows:
http://YourUrl.com/YourPage.aspx?YourValue=foo
AJAX, , page_load .
page_load
, .
ajax .
- javascript, URL- , cookie.
visit these links might be it helps you
http://www.codeproject.com/Answers/219800/How-to-get-hidden-field-value-using-javascript-in-.aspx#answer3
HiddenField
, , , Response.Redirect . . ajax .
, OnPageLoad - .
-, ? .
viewstate ,
public string NavigateUrl { get { string text = (string) ViewState["NavigateUrl"]; if (text != null) return text; else return string.Empty; } set { ViewState["NavigateUrl"] = value; } }