Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I need to display a popup when page takes more than 10 seconds to load a page. It is a Asp.net application using C#.We have two servers. when user clicks on a link on one server required details will be taken form another server at backend and then it will display a IE which contains a document. I need to display a pop up when the IE page is taking more time to load a page.

Thanks.
Posted
Comments
StianSandberg 23-Apr-13 9:28am    
this has nothing to do with asp.net or c#, but html and javascript. You have to add som javascript with a timer wchich is canceled at the bottom of the page after an amount of time.
sravya potturi 24-Apr-13 6:21am    
Used below code but it is not displaying popup after 10 seconds.

<script type=""text/javascript">

setTimeout(fnShowPopup, 10000);
function fnShowPopup(){
var answer = confirm(It may take few time to open this document. Click YES if you want to open the docuemnt in native format or click on CANCEL to continue viewing the document)
if (answer)
alert(Hello World)
}


</script>

1 solution

Used below code but it is not displaying popup after 10 seconds.



setTimeout(fnShowPopup, 10000);
function fnShowPopup(){
var answer = confirm(It may take few time to open this document. Click YES if you want to open the docuemnt in native format or click on CANCEL to continue viewing the document)
if (answer)
alert(Hello World)
}


<script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900