Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi
I open a pop up page(child page) by using jquery(jquery.colorbox.js) in asp.net application. Now when I click on search button I want to close the pop up page(child page) and refresh the UpdatePanel1 by using search parameters.
for above I need to execute server side function in parent page.

So please can any one help me how can I call server side function while closing pop up page and I should be able to get search parameter values in server side function.

Code to close pop up:

child.aspx:
JavaScript
<script>
     function closePopup() {
         parent.$.fn.colorbox.close();
         return true;
     }
</script>

child.aspx.cs:
C#
protected void Page_Load(object sender, EventArgs e)
        {
            btnSearch.Attributes.Add("onClick", "return closePopup();");
        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
        }
Posted
Updated 24-Mar-11 4:32am
v3

1 solution

There can several ways.
One is that you can have a hidden field and set your search parameters at client side while closing popup and get the value of this hidden field at server side.
 
Share this answer
 
v2
Comments
Dalek Dave 24-Mar-11 9:42am    
Good Advice.
trilokharry 25-Mar-11 0:49am    
thanks for kind reply.
it is fine but how can I call server side function at the time of closing popup because I dont want to refresh parent page. parent page only partially will be updated.

thanks

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