Do postback on parent window

Hi All,

I have aspx page 1 that has gridviews that query the database.  When an action happens I open aspx page 2  using window.showModalDialog(passing some parameters).  From page two i need to be able to click a button and have the parent page (page 1) do a postback (which will refresh the data in the gridviews).

I have been searching the web but havent gotten anything to work.

Any solutions?

Who is Participating?
Put this script in page1

    <script language="javascript">
            function postback()
            <%= Page.ClientScript.GetPostBackEventReference(this, "") %>

Then in page2, run this javascript to postback page1

joan2006Author Commented:
raterus, this does a postback but it not requrying the data or properly refreshing the page.  

Any suggestions?
I was hoping you'd know what needed to run to do that :-)
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

joan2006Author Commented:
Well i had to rebind the data and it worked perfectly, thanks!
joan2006Author Commented:
ALSO, this solution did NOT work with javascripts window.showModalDialog .. I had to use  I wanted to use a modal window to prevent the user from switching back and fourth between browsers but my time is getting limited.

It does work in Firefox 3.0.  These modal dialogs are fairly "new" so you probably have to use different code for different browsers.  Sorry, but I don't know what works off the top of my head in IE.  Looks like you might be able to catch a return value and call the postback() function based on that, I really don't know.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.