Click here to Skip to main content
15,886,723 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to show pop up after every 5 minutes.how can i create and show popup..
like http://www.magicbricks.com/[^]
Posted

Hi,

try this for your requirement

HTML
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
    <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script language ="javascript" >
        var tmp;
        function f1() {
         
            document.getElementById("popupdiv").style.display = '';
            tmp = setTimeout("f2()", 1000);
        }
        function f2() {
           
            document.getElementById("popupdiv").style.display = 'none';
            tmp = setTimeout("f1()", 2000);
        }
    </script>
</head>
<body onload="f1()">
    <form id="form1" runat="server">
    <div>
      <div id="popupdiv" style="removed:fixed; removed0px; removed0px; background-color:Red; width :100%;">
       This is popup <br />
      </div>
    </div>
    </form>
</body>
</html>


And modify it to achieve exact your requirement

All the Best
 
Share this answer
 
v2
Comments
Anuja Pawar Indore 13-Oct-11 6:32am    
My 5
soniya sangal 13-Oct-11 6:39am    
its not woking
Muralikrishna8811 13-Oct-11 6:42am    
are you add reference to jquery files?
soniya sangal 13-Oct-11 6:43am    
no...dont have
Muralikrishna8811 13-Oct-11 6:44am    
k no prob

check again my solution I update it for basic javscript
For pop up using Window.Open> method you can find some good resources at :
1. http://www.tizag.com/javascriptT/javascriptpopups.php
2. http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

You can also generate the code for your pop up depending on the requirements using some online Pop up Generators :
1. http://javascript.internet.com/generators/popup-window.html
2. http://www.javascriptkit.com/popwin/index.shtml

For some customised pop ups which provide more functionality you can refer to
1. Leightbox[^]
2. Lighbox[^]
3. Greybox[^]

These links explain the use of customised pop ups with example.

Hope this helps.
All the best.
 
Share this answer
 
Comments
RaviRanjanKr 13-Oct-11 11:58am    
Nice Link Pravin, My 5+
Pravin Patil, Mumbai 14-Oct-11 0:57am    
Thanks Ravi...
 
Share this answer
 
Comments
soniya sangal 13-Oct-11 6:26am    
sory i am not geting
Amol_27101982, India 13-Oct-11 6:42am    
ModalPopupExtender is an AJAX extender which you can use to get a popup on a web page. Just go through above links.
Amol_27101982, India 13-Oct-11 6:44am    
Keep running a timer of 5 min. on the page.
1. Make pop up:(as the Muralikrishna88115 has created using the div)

2. Make a timer (timer1) in aspx page by dragging the Timer control from toolbox
3.write the following where u want to open the popup (eg. In PageLoad):

C#
System.Timers.Timer time = new System.Timers.Timer();
 time.Start();

then
4.Add the tick event to timer

5.in the tick event write the code to open the popup.
C#
eg:divId.attributes.add("display","block");
 
Share this answer
 
v11
Comments
soniya sangal 13-Oct-11 6:41am    
can u explain me briefly because i dont knw how to make pop up
member60 13-Oct-11 6:49am    
u can use a div as apop up as
<div id="popupdiv" style="display: none; background-color:Red; width :100%;">
xyz tags of div u want to show as pop up <br />
</div>
or u can use css popups etc.
member60 13-Oct-11 6:52am    
in the tick event open the pop by:
divID.attributes.add("display","block");
or
soniya sangal 13-Oct-11 7:04am    
<div id="popupdiv" style="removed:fixed; removed0px; removed0px; background-color:Red; width :100%;">
This is popup <br />
</div>
<div id="Div1" style="display: none; background-color:Red; width :100%;"> xyz tags of div u want to show as pop up <br /> </div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="t1" EventName="Tick" />
</Triggers>

<asp:Timer ID="t1" runat="server" Interval="15000">

then what i do??
soniya sangal 13-Oct-11 6:54am    
actully i am new...so can u give me a whole code of my problem
 
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