Sunday, 29 September 2013

Asp.net calling two functions

Asp.net calling two functions

Spent almost two days trying to figure out this problem. I have modal
popup with dynamic checbox list (generated from database) and close button
on modal popup. What I want is that when user click 'Close' button, then
modal popup is closed but the same time I want to get all selected
checboxes values to save in string.
<asp:Button ID="btnHide" runat="server" Text="Close"
OnClick="btnHide_Click" OnClientClick="HideModalPopup()"/>
protected void btnHide_Click(object sender, EventArgs e)
{
string names=checkCheckboxes(); //calling WORKING function
which reutrns all selected checboxes from modal popup in a
string, splited by comma
Response.Write(names); //trying to write 'names' variabile
which contains all selected checboxes on screen
}
jQuery function:
function HideModalPopup() {
$find("mpe").hide();
return false;
}
Problem is that when I click close button, modal popup disapeared, but no
values are saved to variabile 'names' in btnHide_Click method. How can I
get selected checkboxes from modal popup to this function? What is wrong
with this code?
Please help me out.

No comments:

Post a Comment