how can I get the value of hidden field in my code behind?
I have tried getting it using javascript, but I want to do it in code behind so I can use it when I
pass the value on the other page.
- function load() { var lblAddress = document.getElementById("hdnAddress").value; var lblName = document.getElementById("hdnName").value; var lblEmail = document.getElementById("hdnEmail").value; var lblPhone = document.getElementById("hdnPhone").value; var lblMsg = document.getElementById("hdnMsg").value; window.parent.document.getElementById("lblAddress").innerText = lblAddress; window.parent.document.getElementById("lblName").innerText = lblName; window.parent.document.getElementById("lblEmail").innerText = lblEmail; window.parent.document.getElementById("lblPhone").innerText = lblPhone; window.parent.document.getElementById ("lblMsg").innerText = lblMsg;
-
NOTE:
The flow of this is:
- first the hidden fields is in separate page(Page2).
- then I will get the value of that using the javascript code above and set the value of label on the other page(Page1) with the value of hidden field.
The Page2 is placed on the iframe inside Page1.