This is a migrated thread and some comments may be shown as answers.

Postback on Check only

2 Answers 131 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 27 Apr 2010, 07:35 PM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 28 Apr 2010, 07:25 AM

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.

0
Ernest Mombay
Top achievements
Rank 1
answered on 04 Jan 2011, 08:53 PM
Thanks Shinu. Been looking for this post all day.
Tags
ListBox
Asked by
John
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Ernest Mombay
Top achievements
Rank 1
Share this question
or