Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Do postback on parent window

Posted on 2008-06-20
Medium Priority
Last Modified: 2008-06-23
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?

Question by:joan2006
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 33

Accepted Solution

raterus earned 2000 total points
ID: 21834750
Put this script in page1

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

Then in page2, run this javascript to postback page1


Author Comment

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

Any suggestions?
LVL 33

Expert Comment

ID: 21849039
I was hoping you'd know what needed to run to do that :-)
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 21849132
Well i had to rebind the data and it worked perfectly, thanks!

Author Comment

ID: 21849301
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.

LVL 33

Expert Comment

ID: 21849659
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.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question