I didn't see where you actually set the session variables. But on a
page receiving a post you could do something like this to set them:
Session("UserName") = Request.Form("UserName")
Session("UserLevel") = Request.Form("UserLevel")
Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
<<
All the files are in the same IIS application.
I do not get error messages. A get the result wrong data'.
The login filters Usr and Password and reads from SQL the profile. I
need to
use this profile in many pages from there on, and I can use it in the
first
page I go to. It seems like the Session variables were deleted or had a
ver
short live. Funny?
So I have a login, and a validation page, and a Form page. Up until now
every thisn is correct. The form page has a combo that is filled with a
recorset and then all the values are sent using this jscipt:
function PasaValoresFab()
{ var Fabrica = document.frmConsulta.Fabrica.value
var VecFabrica = Fabrica.split("-");
document.frmConsulta.cFabrica.value = VecFabrica[0]
document.frmConsulta.NombreFabrica.value = VecFabrica[1]
}
This is the combo code:
<select name="Fabrica" tabindex="10"
onChange="javascript
asaValoresFab();">
<option selected>Escoja la fc!brica</option>
<%Call ComboGR(Fabricas)%>
This is the code for the form:
<form method="post" action="resultado.asp" name="frmConsulta"
onSubmit="return ActivarFiltro();">
And this is the code for the ActivarFiltro:
if (document.frmConsulta.cFabrica.value != "")
{ Vec[12]="(MILL ='"+document.frmConsulta.cFabrica.value +
"')"
Vec2[12]="Fabrica = "+document.frmConsulta.cFabrica.value +
" ("+
document.frmConsulta.NombreFabrica.value +") "
}
Kind of confusing? The result page has this at some point:
IF PACASOLA = "SI" THEN
Call ActivarFiltroVB()
ELSE
Where Activar Filtro has this at some point:
IF Session("PERFIL") = 3 THEN
Ag = Session("CODIGO")
Session("StrSQL") = Session("StrSQL") & "AND Agency = '" & Ag &
"' "
END IF
If Session("PERFIL") =2 THEN
Fa = Session("Codigo")
Session("StrSQL") = Session("StrSQL") &" AND Agency is not null
AND "
Session("StrSQL") = Session("StrSQL") &" MILLS = '" & Fa & "' "
END IF
And here is part of the problem: the Session Variable PERFIL is lost, I
can't make it work.
Well, I guess it is all!
Thanks a lot, Lina