Postback on Check only

3 posts, 0 answers
  1. John
    John avatar
    88 posts
    Member since:
    Nov 2007

    Posted 27 Apr 2010 Link to this post

    Is there a way to make it so the listbox only postbacks on check and not also on selection?

    I have AutoPostBack="true" and OnItemCheck set to my server side function.  It works great, but when you click on an item and not the check box, it posts back as well.  Is there a way to stop that postback but still allow the checkbox check postback?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 28 Apr 2010 Link to this post

    Hi John,

    Try the following approach in order to postback only when checking the checkboxes in RadListBox.

    JavaScript:

     
    <script type="text/javascript">  
        function OnClientSelectedIndexChanged(sender, args) {  
            sender.set_autoPostBack(false);  
            // alert("Selected");  
        }  
        function OnClientItemChecked(sender, args) {  
            sender.set_autoPostBack(true);  
        }  
    </script> 

    Also set the AutoPostBack property to true for the RadListBox.

    -Shinu.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ernest Mombay
    Ernest Mombay avatar
    23 posts
    Member since:
    Jun 2009

    Posted 04 Jan 2011 Link to this post

    Thanks Shinu. Been looking for this post all day.
Back to Top