Click here to Skip to main content
15,909,939 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i had a page on which two controls:



textbox and dropdown will be there.and there willl be a submit button.on clcik of submit button i am displaying pop up.the pop up contains one button.on clcik of that i will close the pop up.the cod eis :



<asp:Button ID="btnClose" OnClientClick="self.closepopup(); return false" Text="Close"


now my requirement is at the same time i nned to reset the controls .so can i write a server side event for the same butto and reset the controls in that click
Posted
Updated 10-Jan-14 5:20am
v2

Yes, just add OnClick="SomeServerSideEvent".

Define the event in code behind and do whatever you want.
protected void SomeServerSideEvent(Object sender, EventArgs e)
{
    // Do whatever you want to do.
}
 
Share this answer
 
v2
Comments
spanner21 10-Jan-14 8:43am    
hi tadit firt of all thanks but i am getting some problem in closing pop up also ,when i clcik on the link button on th epop up suppose say close button if i click it my pop up nneds to be close ...but its not closing giving javascript error so pls suggest
What is that error? Post you codes also which is closing the popup.
spanner21 13-Jan-14 1:45am    
Hi tadit,

this is my code for closing the pop up:

<asp:Button ID="btnClose" OnClientClick="self.closepopup(); return false" OnClick="btnClose_Click" Text="Close" runat="server"/>


and on clikc i am clearing my textbox.

please help how to close the pop up
What popup is that? jQuery / JavaScript / Ajax ModalPopupExtender. I need to see that.
Please post the codes.
below the code snippet ,
C#
Button_Click()
{

 Response.Write("<script>window.close();</script>");
 Response.End();
 //reset the necessary controls 
}

It should work. It works for me.
Plz reply back if u got any problem...
 
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