showModalDialog problem very serious

Hi Folks ,

       I am working on a ASP.NET application where i need to show a popup window  on the main
screen , when i click on a link on the main screen . For that  purpose , i used showModalDialog() .

In the showModalDialog popup , while loading the popup in the Page_Load() event , i am  
accessing the database  ,  and depending on the business logic  I am  dynamically generating
contents of the popup window.

Using showModalDialog  also serves my purpose of restricting access to the main screen.

But there are some problems .

1) Though the contents in the  database  is changing ,  the same is not geting reflected in the
    popup window.

    This happens , immaterial of how many times i open that popup window and close it .

    But this behaviour stops , once i close the browser window and open the same in another
    browser window.  

    Is there any way of tackling it ?
    Is the content of the showModaldialog once loaded remains static , irrespective of change in

2) When i click on the Ok button of the showModalDialog , the page is not getting refereshed.
    Will Page refresh doesn't work in   showModalDialog?

Can anyone suggest me continuing with showModalDialog or try any other new thing ???

I even tried DHTMLModalDialog  which doesn't serve my purpose as , though it restricts focus  to
the  main screen , it  is  allowing  me to access the Internet Explorer menu on the main screen.

Any suggestions except DHTMLModalDialog is welcome.

I need ur deseparate  help  in this regard , as i am hanged out here.

Thank you folks in advance

Who is Participating?
ZvonkoConnect With a Mentor Systems architectCommented:
Both requests are solved easy :)

To make your page in the popup refresh every time add some random parameter to the query string. For example, add the time ticks as parameter.
And for parent window refresh use window.location.reload() immediately after showModalDialog() call.
Like this:

sUrl += ((sUrl.indexOf('?')<0)?"?":"&")+"time="+(new Date()).getTime();
retVal=window.showModalDialog(sURL, window);

Good luck,

ZvonkoSystems architectCommented:
Here a tested version:

function showDia(sURL){
  sURL += ((sURL.indexOf('?')<0)?"?":"&")+"time="+(new Date()).getTime();
  retVal=window.showModalDialog(sURL, window);
<a href="" onClick="return showDia(this.href)">EE</a>
<script>document.write(new Date())</script>

you can embed a frame and load the page in that frame giving src to the file you want to open and it will work fine.
No hi Fanda
you can embed a frame in the window and load the page in that frame giving src to the file you want to open and it will work fine.
No hi Fanda

You can close
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.