That means every time new page loads, after 1 minute the popup will show. Now i have two issues regarding this:
1) I want to show the popup only right just once, 1 minute after website opens. After that if user cancel it, i dont want to show it again.
2) I have a small form (containing server controls) inside popup, if user(anonymous or authenticated) submit the forms then i dont want to show the popup again.
- Save the Submission data with User's IP address ( in anonymous case) or UserName (in Authenticated case), query the information from your database and set the IsSubmitted variable true or false.
OR
best way to detect the form was submmited or not is to read from Cookie in your scenerio i guess. and set the IsSubmitted variable based on Cookie result.
if you are imeplents this on master page then i will show on every page load method
I thought it would be better if its in master page so it can show irrespective of which page user is visiting.
SohailShaikh
please put this on every page
will that not be similar to like puting in each master page.
SohailShaikh
now your second soultion is if user cancel this then put a value in hidden field or session and check this value on every page load if value is true then show popup again else dont show simple
Can you give example for this. for canceling popup i am using this:
function doClose(e) {
if (!e) e = window.event;
if (e.keyCode == "27") {
disablePopup();
}
else if (e.charCode) {
if (e.charCode == "27") disablePopup();
}
}
when popup occure after 3 second please cancel that and change the page or goto about page
then select you can see the popup will occure again now you select ok after this popup will not show any more because if store value in javascript session if you need any help please let me know
Mark As Your Answer if You think its Help you
Sohail Shaikh
Marked as answer by rajesh saharan on Dec 19, 2012 11:07 AM
Thanks Sohail, your program not workin on my system, anyway i dont want to use session.
SohailShaikh
put a value in hidden field
This looks simple, but i have a concern i.e whether user have submitted the form or cancel the popup, in both the cases i want to set the hidden field value so that the popup will not show again. But doing this will change the value permanently. So a new
user will never be able to see the popup.
here i m not set value in hidden field i m sotring value in client side session this library interdouce in html 5 please take a complete visit of my demo i hope you will understand this i m just check value from session before popup if session have value
then popup will not occure
Hidden field loss the value every time thats y i m using client side session you can not access this session on server side directly and there is no need to declare html 5 every new browser automatic add this line
Mark As Your Answer if You think its Help you
Sohail Shaikh
Marked as answer by rajesh saharan on Dec 19, 2012 11:07 AM
rajesh sahar...
Member
225 Points
553 Posts
Issues while implementing jQuery popup
Dec 18, 2012 05:46 AM|LINK
I am showing a jquery popup 1 minute after website is opened. Until know i am implementing this on each master page like this:
$(document).ready(function () { setTimeout(function () { Popup() }, 60000); });That means every time new page loads, after 1 minute the popup will show. Now i have two issues regarding this:
1) I want to show the popup only right just once, 1 minute after website opens. After that if user cancel it, i dont want to show it again.
2) I have a small form (containing server controls) inside popup, if user(anonymous or authenticated) submit the forms then i dont want to show the popup again.
How to solve these issues ?
SohailShaikh
Contributor
6109 Points
1167 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 06:03 AM|LINK
if you are imeplents this on master page then i will show on every page load method please put this on every page
now your second soultion is if user cancel this then put a value in hidden field or session and check this value on every page load if
value is true then show popup again else dont show simple
Sohail Shaikh
furry
Member
584 Points
108 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 06:18 AM|LINK
- Introduce two javascript variable.
- Modify your JS something like this ( didn't test the code, but you can get the idea)
$(document).ready(function () { if(!_TimeHandler && !_IsAlreadySubmitted) { setTimeout(function () { Popup(); _TimeHandler = true; }, 60000); } });rajesh sahar...
Member
225 Points
553 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 06:39 AM|LINK
I thought it would be better if its in master page so it can show irrespective of which page user is visiting.
will that not be similar to like puting in each master page.
Can you give example for this. for canceling popup i am using this:
function doClose(e) { if (!e) e = window.event; if (e.keyCode == "27") { disablePopup(); } else if (e.charCode) { if (e.charCode == "27") disablePopup(); } }SohailShaikh
Contributor
6109 Points
1167 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 07:58 AM|LINK
there is a demo program please download from givien link program name is =LoadPoupUp
https://skydrive.live.com/#cid=2F22272220E37707&id=2F22272220E37707%21103
when popup occure after 3 second please cancel that and change the page or goto about page
then select you can see the popup will occure again now you select ok after this popup will not show any more because if store value in javascript session if you need any help please let me know
Sohail Shaikh
rajesh sahar...
Member
225 Points
553 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 08:42 AM|LINK
Thanks Sohail, your program not workin on my system, anyway i dont want to use session.
This looks simple, but i have a concern i.e whether user have submitted the form or cancel the popup, in both the cases i want to set the hidden field value so that the popup will not show again. But doing this will change the value permanently. So a new user will never be able to see the popup.
SohailShaikh
Contributor
6109 Points
1167 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 08:54 AM|LINK
here i m not set value in hidden field i m sotring value in client side session this library interdouce in html 5 please take a complete visit of my demo i hope you will understand this i m just check value from session before popup if session have value then popup will not occure
Sohail Shaikh
rajesh sahar...
Member
225 Points
553 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 09:21 AM|LINK
That means it is not possible through hidden field i guess.
Ok it is client side session. i thought of serverside session which looses the variables all the times.
I am not using HTML 5. My doctype is:
SohailShaikh
Contributor
6109 Points
1167 Posts
Re: Issues while implementing jQuery popup
Dec 18, 2012 09:32 AM|LINK
Hidden field loss the value every time thats y i m using client side session you can not access this session on server side directly and there is no need to declare html 5 every new browser automatic add this line
Sohail Shaikh
asteranup
All-Star
30184 Points
4906 Posts
Re: Issues while implementing jQuery popup
Dec 19, 2012 04:43 AM|LINK
Hi,
Save the value in cookie and read the value from cookie and accordingly show the popup. Check the following posts to use cookie-
http://www.delicious.com/anupdg/cookie
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.8.3.js"></script> <script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <script> $(function () { if (getCookie("selection") !== "0") { $('#dialog').dialog({ modal: true, buttons: { Close: function () { $(this).dialog("close"); setCookie("selection", 0, new Date()); } } }); } }); function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value; } function getCookie(c_name) { var i, x, y, ARRcookies = document.cookie.split(";"); for (i = 0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("=")); y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1); x = x.replace(/^\s+|\s+$/g, ""); if (x == c_name) { return unescape(y); } } } </script> </head> <body> <form id="form1" runat="server"> <div id="dialog" title="Basic dialog"> <p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p> </div> </form> </body> </html>Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog