Monday, July 2, 2012

ASP.NET jQueryUI Button: server side event not firing


While using a jQuery UI button inside a Dialog, the button’s click event will not get fired, this is because while adding the control to the Dialog it is moved out of the form hence the click event will not get fired.

To make the click event to get fired, we have 3 options.



The first 2 options will trigger the server side event, but the values entered in the dialog controls will not be available in the server side code.

In the 3rd option, the event will get triggered and the values entered in the dialog controls will be available in the server side code.

1. Setting the UseSubmitBehavior property of the button to false.
    Refer PostAsp.net jQuery Dialog buttons do Post back using UseSubmitBehavior

2. Adding the post back reference to the button using jQuery.
    Refer PostAsp.net jQuery Dialog buttons do Post back.

3. Appending the dialog controls back to the form using jQuery.
    Refer PostAsp.net jQuery Dialog control events not firing

Related Post


Search Flipkart Products:
Flipkart.com

No comments: