post back on the parent window when pop-up is closed

  • Thread starter Thread starter ram_kri
  • Start date Start date
R

ram_kri

Hi,
In my ASP.NET application, I have a page on which I have a LinkButton
control and when clicked on it, it opens-up a pop-up window (which is an
ASP.NET page). The way it opens the pop-up is by registering a javascript
using "RegisterStartupScript" in the LinkButton - onClick event handler.

Now after I am done with working on the pop-up, I obviously close it and I
want the parent page to be refreshed (postback should happen) after the
pop-up is closed(automatically).

Any thought on how do we achieve this ?

Have a nice day.

Regards,
Kris
 
Hi Teemu,
Thanks for this.
I did the same as what you have suggested in the blog but I get the
following error :
-------------
Invalid postback or callback argument. Event validation is enabled using
<pages enableEventValidation="true"/> in configuration or <%@ Page
EnableEventValidation="true" %> in a page. For security purposes, this
feature verifies that arguments to postback or callback events originate
from the server control that originally rendered them. If the data is
valid and expected, use the ClientScriptManager.RegisterForEventValidation
method in order to register the postback or callback data for validation.
-------------

Do I need to call that method it is suggesting ?
I just started looking into it. But it would be great if you can let me
know what's going on here.

Have a nice day.

Thansk a ton.

Regards,
Kris
 
Hi,
I got it working in a different manner as below:
-------------
string scriptString = "<script language=JavaScript>
window.opener.document.forms(0).submit(); </script>";
if
(!Page.ClientScript.IsClientScriptBlockRegistered(scriptString))
{

Page.ClientScript.RegisterClientScriptBlock(this.GetType(),
"submitScript", scriptString);

}
----------------

This way I got it working. But I would love to see the solution for the
exception that I posted also..

Thank you in advance.

Regards,
kris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top