locked
checkbox on page and how to post it to another aspx page RRS feed

  • Question

  • User1820622718 posted

    I have a scenario where I have a page with a checkbox and links.  When a user clicks a specific link and I'm taken to that page I need to know if the checkbox was checked on the previous page to decide what to display.

    Here is my code for the checkbox on page1

    <script type="text/javascript">  
      function fncTemp() {
        var chk = document.getElementById('chkTemp').checked;
        var hdn = document.getElementById('hdnTemp');
        if (chk == true) {
          hdn = 1;      
        }
        else {
          hdn = 0;      
        }
      }
    </script>
    
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
      <input type="checkbox" id="chkTemp" name="chkCDS" onchange="fncTemp();" />
      <label id="lblTemp" class="pagetext_10">Valid User Check?</label>
    	<uc2:About ID="ctlAbt" runat="server" />
      <input type="hidden" name="hdnTemp" runat="server">
    </asp:Content>

    When I click on a link which is part of the user control how can I know what value is in hdnTemp?

    Thank you

    Friday, August 12, 2016 4:50 PM

Answers

All replies