...

View Full Version : Hello, cant make this script to go.



atferraz
12-06-2003, 06:42 AM
<%
nstate = rs("nstate")
observ = rs("observ")
if cInt(nstate)>0 then
%>
<script type="text/javascript">
var nstate =<%=nstate%>;
var observ ="<%=observ%>";
popUp(nstate,observ);
</script>
<%
if cInt(nstate)=2 and cInt(Session("UserNfunc"))>0 then
response.Redirect"Main_Backgr.asp"
exit sub
end if
end if
%>

This script tests if the state of a DB row is 0,1 or 2. If it is 1 or 2 shows a message in a popup window. Thatís what popup() do.
When is 2, it should redirect the user out, after that popup window close.(it is a modal window)
The problem is that when both cInt(nstate)=2 and cInt(Session("UserNfunc"))>0 conditions are true it gets redirect but doesnít show the pop up window.

Please some one

A1ien51
12-06-2003, 03:37 PM
because this runs on the server side, the pop up window happens after onload. The redirect will happen first.

Eric

glenngv
12-06-2003, 05:20 PM
What you can do is let the redirection happen in client-side (javascript)

<script type="text/javascript">
var nstate =<%=nstate%>;
var observ ="<%=observ%>";
popUp(nstate,observ);
if (nstate==2 && <%=Session("UserNfunc")%>>0)
location.href = "Main_Backgr.asp";
</script>

atferraz
12-10-2003, 08:13 PM
thanks got you both.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum