Joem Orcullo

Joem Orcullo

  • NA
  • 10
  • 14.4k

How to get the value of hiddenfield and pass to another page

Mar 21 2016 2:50 PM
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.
  1. 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; // alert(lblAddress); 
  2. }  

NOTE:

  1. 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.
  2. The Page2 is placed on the iframe inside Page1. 

 
 

Answers (2)