Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my webform, I have a GridView with checkboxes in it. I want to show this GridView in a jquery modal popup and allow users to check checkboxes to select the rows. When the user makes a selection, I want to get the DataKeyName and process it in the OnCheckedChanged event of the checkbox. When I call the 'change' event from jquery, the serverside code fires only if I set AutoPostback=true for the checkboxes, with the fall out that the modal popup dialog is closed automatically.

Is it possible to call OnCheckedChanged event of the CheckBox without postback? Or any way of reloading the GridView after the postback?

What I have tried:

function ShowPopup() {
$("#dialog").dialog({
title: "GridView",
width: 1100,
autoOpen:true,
buttons: {
Ok: function () {
$(this).dialog('close');
},

},
open: function (type, data) {
$(this).parent().appendTo($("form:first"));
$("input[type=checkbox]").click(function () {
$("input[type=checkbox]").trigger("change");
}
},
modal: true
});
}
Posted
Updated 16-Sep-16 19:10pm

1 solution

Quote:
Is it possible to call OnCheckedChanged event of the CheckBox without postback?

No way
but what you can do is just copy the code indside the event to a web method and invoke it using Ajax call, provided you are not using any depenedencies related to the event arguments.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900