?
Solved

showModalDialog problem very serious

Posted on 2004-04-07
7
Medium Priority
?
301 Views
Last Modified: 2007-12-19
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
    database?
   

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

Naveen
0
Comment
Question by:hainaveen_2001
[X]
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
  • 2
7 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 360 total points
ID: 10774160
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);
window.location.reload(true);


Good luck,
Zvonko


0
 
LVL 63

Expert Comment

by:Zvonko
ID: 10775026
Here a tested version:


<html>
<head>
<script>
function showDia(sURL){
  sURL += ((sURL.indexOf('?')<0)?"?":"&")+"time="+(new Date()).getTime();
  retVal=window.showModalDialog(sURL, window);
  window.location.reload(true);
}
</script>
</head>
<body>
<a href="http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20946345.html" onClick="return showDia(this.href)">EE</a>
<script>document.write(new Date())</script>
</body>
</html>


0
 
LVL 1

Expert Comment

by:i_rajeevsingh
ID: 10898039
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
0
 
LVL 1

Expert Comment

by:i_rajeevsingh
ID: 10898043
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

regards
rajeev
0
 
LVL 1

Expert Comment

by:i_rajeevsingh
ID: 11079949
You can close
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
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…
Suggested Courses

800 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