Guest_imported
New member
- Jan 1, 1970
- 0
I have an ASP page where a database is accessed to determine a record count in a particular table and using a javascript alert box to tell the user how many records there are.
Now, I'd like the user to be able to go to a different page on the site and not have this box pop up when they come back to this page. (I only want the popup on the first viewing of the page.) However, I do want the popup to run again if the user leaves my site and comes back.
Here's the code I'm currently using:
<%
if not Session("Alerted"
or Session("Alerted"
= "" then
dim m_connLawyer
dim m_objLawyer
dim dicLawyer
dim regPending
set m_connLawyer = server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
set m_objLawyer = server.CreateObject("Register.Utility"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
set dicLawyer = server.CreateObject("Scripting.Dictionary"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
m_connLawyer.Open g_conn 'global connection string
regPending = "false"
Set dicLawyer = m_objLawyer.GetUnapprovedLawyer(m_connLawyer)
if dicLawyer.Count > 0 then
%>
<script language="javascript">
alert("There are <%=dicLawyer.Count%> new lawyer registrations pending approval"
;
</script>
<%
end if
Session("Alerted"
= "true"
end if
%>
Now, I want Session("Alerted"
to empty when the user leaves the site. I've tried setting it to = "" in global.asa but since the session timeout is 20 minutes, it doesn't work consistently. And I need the timeout to be 20 minutes for other variables. Any ideas on what I can do?
Now, I'd like the user to be able to go to a different page on the site and not have this box pop up when they come back to this page. (I only want the popup on the first viewing of the page.) However, I do want the popup to run again if the user leaves my site and comes back.
Here's the code I'm currently using:
<%
if not Session("Alerted"
dim m_connLawyer
dim m_objLawyer
dim dicLawyer
dim regPending
set m_connLawyer = server.CreateObject("ADODB.Connection"
set m_objLawyer = server.CreateObject("Register.Utility"
set dicLawyer = server.CreateObject("Scripting.Dictionary"
m_connLawyer.Open g_conn 'global connection string
regPending = "false"
Set dicLawyer = m_objLawyer.GetUnapprovedLawyer(m_connLawyer)
if dicLawyer.Count > 0 then
%>
<script language="javascript">
alert("There are <%=dicLawyer.Count%> new lawyer registrations pending approval"
</script>
<%
end if
Session("Alerted"
end if
%>
Now, I want Session("Alerted"