Value, When I Check the Check Box

Last post 02-12-2008 2:46 AM by Hong-Gang Chen - MSFT. 5 replies.

Sort Posts:

  • Value, When I Check the Check Box

    02-07-2008, 6:58 AM
    • Loading...
    • vik1987
    • Joined on 08-25-2007, 10:31 AM
    • Posts 57

    Is there any way when I select the check Box, it update the total value but Page should not be post Back.

    That means i want to select the corresponding value at the time of Check Box Click.

    Thanks

     

     


     

     

  • Re: Value, When I Check the Check Box

    02-07-2008, 9:08 AM
    • Loading...
    • kunal pawar
    • Joined on 02-07-2008, 1:51 PM
    • Pune
    • Posts 1

    Do u mean, u want post back page after click on check box

  • Re: Value, When I Check the Check Box

    02-07-2008, 9:11 AM
    Answer
    • Loading...
    • vinz
    • Joined on 10-05-2007, 11:47 AM
    • Cebu Philippines
    • Posts 8,260

    You can use the aspnet ajax updatepanel control and wrap your controls within that panel so that it will not refresh everytime you will check a checkbox and fired the event... another thing is you can use JavaScript and handle the stuff at the Client Side since you dont want to post back on the server...

    more info about UpdatePanel control then you can check this out

    http://www.asp.net/ajax/documentation/live/overview/UpdatePanelOverview.aspx 


    Regards,
    Vincent Maverick Durano

    Please post questions to the forums, where others may benefit.I do not offer free assistance by e-mail. Thank you!



  • Re: Value, When I Check the Check Box

    02-07-2008, 9:39 AM
    • Loading...
    • vik1987
    • Joined on 08-25-2007, 10:31 AM
    • Posts 57

    There are any other way except ajax Tool.

  • Re: Value, When I Check the Check Box

    02-07-2008, 10:12 AM
    Answer

    Well if you dnt wna use Ajax you can do this by Javascript.

    What really you want to achive.

    I believe you have a checkbox and you want to populate selected item in some textbox but without postback is it?
     

    ~ Remember To Mark The Post(s) That Helped You As The ANSWER ~
  • Re: Value, When I Check the Check Box

    02-12-2008, 2:46 AM
    Answer

    vik1987:

    Is there any way when I select the check Box, it update the total value but Page should not be post Back.

    That means i want to select the corresponding value at the time of Check Box Click.

     

    Hi vik1987,

    Please refer the following code snippet:

    <script type="text/javascript">
    <!--
    ///////////////////////////////////////////////////////////////////
    // var containerId = '<%= CheckBoxList1.ClientID %>';
    // iterateListControl(containerId);
    ///////////////////////////////////////////////////////////////////
    function iterateListControl(containerId)
    {
     var containerRef = document.getElementById(containerId);
     var inputRefArray = containerRef.getElementsByTagName('input');

     for (var i=0; i<inputRefArray.length; i++)
     {
      var inputRef = inputRefArray[i];

      if ( inputRef.type.substr(0, 8) == 'checkbox' )
      {
       if ( inputRef.checked == true )
        alert('#' + i + ' (' + inputRef.id + ') is checked');
      }
     }
    }
    // -->
    </script>

     

    And see the original link:  http://forums.asp.net/p/985229/1268269.aspx

    Let me know if I have misunderstood what you mean. Thanks.

    Hope it helps,

    Hong Gang
     

     

    Sincerely,
    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as
    Answer” if a marked post does not actually answer your question.
Page 1 of 1 (6 items)
Microsoft Communities
Page view counter