locked
How to get values from .aspx page tp .aspx.cs page? RRS feed

  • Question

  • User-1727942399 posted

    Hi, In Javascript I'm storing some value at .aspx page. I need to get that value during page_Load time to .aspx.cs page.

     

    How to get value from .aspx page tp .aspx.cs page

    Monday, April 8, 2013 1:53 PM

Answers

  • User-1360095595 posted

    document.getElementById('<%= Master.FindControl("hdndatr").ClientID %>').value

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 8, 2013 3:21 PM

All replies

  • User-1360095595 posted

    Use a HiddenField. 

    Monday, April 8, 2013 1:58 PM
  • User-1727942399 posted

    Yes, I have kept this Hiddenfield in Master page i need to get the value from Masterpage.      

    But this one is not working..

         <script language="JavaScript" type="text/javascript">
                 var myDate = new Date();
                 var url2 = myDate.getTimezoneOffset();
              
                 document.getElementById("hdndate").value = url2;
               
         </script>

    In aspx.cs page i wrote this

    string    hd = hdndate.Value;

    Monday, April 8, 2013 2:45 PM
  • User-1360095595 posted

    document.getElementById('<%= Master.FindControl("hdndatr").ClientID %>').value

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, April 8, 2013 3:21 PM