0

What I want is: I have a .aspx page. When I click on a button I want a modalpopup like window.open("Popup.aspx, '', '');");

to open

And when the user presses submit button @ popup.aspx I want some other code to execute @ server side of the parent form.

Ex:

    protected void btntext_Click(object sender, EventArgs e)
                {
                    StringBuilder sb = new StringBuilder();
                    sb.Append("<script>");
                    sb.Append("window.open("popup.aspx", "List","scrollbars=no,resizable=no,width=400,height=280"););
                    sb.Append("</script");

                    Page.RegisterStartupScript("test", sb.ToString());
   ** I want that The popup should open here before executing the SaveValue() function
    And I can return some value from that popup.aspx and check here and according to that/execute the code.** 
              SaveValue();
                }
BenMorel
  • 34,448
  • 50
  • 182
  • 322
mR.idiOt
  • 107
  • 2
  • 9
  • I am not able to figure it out. It can be done via javascript popup easily , but how to do it with window.open() ? – mR.idiOt Jan 25 '12 at 07:59

3 Answers3

2

One way, you can adress is using javascript to reload the parent form, when submit button in pop up page is clicked. Also before set the hidden feild in parent form and in page load of the parent form, check for the hidden feild and execute the function that is required.

Nayana Setty
  • 1,001
  • 1
  • 12
  • 34
0

You will have to use Ajax postback and WebMethod for this, check the below link

http://geekswithblogs.net/frankw/archive/2008/03/13/asp.net-ajax-callbacks-to-web-methods-in-aspx-pages.aspx

Jquery AJAX with ASP.NET WebMethod Returning Entire Page

Community
  • 1
  • 1
Ravi Vanapalli
  • 9,805
  • 3
  • 33
  • 43
0

Create a panel with controls you require and assign it to Ajax Asp.NET Modal Popup (link here : http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx ) , so that you can access controls in that popup as well.

Jeswin
  • 96
  • 1
  • 7