Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Session object value not displaying

Reply
Thread Tools

Session object value not displaying

 
 
.Net Sports
Guest
Posts: n/a
 
      07-06-2009
In an asp password script, i'm trying to grab the user's level of
access inside the database and display it on the next page after
successful login

'''login.asp has this:

session("levelAcc")=objRec.fields("levelAcc")


'''the landingpage.asp , the first page afte logging in successfully,
has this:
<%=response.write(session("levelAcc"))%>

....but I do not see the display of the access level on the
landingpage.asp page

???
NS
 
Reply With Quote
 
 
 
 
Evertjan.
Guest
Posts: n/a
 
      07-06-2009
..Net Sports wrote on 06 jul 2009 in
microsoft.public.inetserver.asp.general:

> <%=response.write(session("levelAcc"))%>
>
> ...but I do not see the display of the access level on the
> landingpage.asp page


Elementary, my dear Watson,

[stipulating that we are talking VBS]

It is either:

<% response.write(session("levelAcc")) %>

or better without the unnecessary ():

<% response.write session("levelAcc") %>

or:

<% = session("levelAcc") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
 
 
 
.Net Sports
Guest
Posts: n/a
 
      07-06-2009
On Jul 6, 10:21*am, "Evertjan." <(E-Mail Removed)> wrote:
> .Net Sports wrote on 06 jul 2009 in
> microsoft.public.inetserver.asp.general:
>
> > <%=response.write(session("levelAcc"))%>

>
> > ...but I do not see the display of the access level on the
> > landingpage.asp page

>
> Elementary, my dear Watson,
>
> [stipulating that we are talking VBS]
>
> It is either:
>
> <% response.write(session("levelAcc")) %>
>
> or better without the unnecessary ():
>
> <% response.write session("levelAcc") %>
>
> or:
>
> <% = session("levelAcc") %>
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)


sherlock, it's not working. None of the 3 work. I've even assigned
session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
tried session("levelAcc") ="test", and it doesnt display .
 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      07-06-2009
..Net Sports wrote:
> In an asp password script, i'm trying to grab the user's level of
> access inside the database and display it on the next page after
> successful login
>
> '''login.asp has this:
>
> session("levelAcc")=objRec.fields("levelAcc")
>
>
> '''the landingpage.asp , the first page afte logging in successfully,
> has this:
> <%=response.write(session("levelAcc"))%>
>
> ...but I do not see the display of the access level on the
> landingpage.asp page
>

"<%=" is shorthand for "<% Response.Write", so all that is needed is:
<%=session("levelAcc")%>


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
Evertjan.
Guest
Posts: n/a
 
      07-06-2009
..Net Sports wrote on 06 jul 2009 in
microsoft.public.inetserver.asp.general:

> On Jul 6, 10:21*am, "Evertjan." <(E-Mail Removed)> wrote:
>> .Net Sports wrote on 06 jul 2009 in
>> microsoft.public.inetserver.asp.general:
>>
>> > <%=response.write(session("levelAcc"))%>

>>
>> > ...but I do not see the display of the access level on the
>> > landingpage.asp page

>>
>> Elementary, my dear Watson,
>>
>> [stipulating that we are talking VBS]
>>
>> It is either:
>>
>> <% response.write(session("levelAcc")) %>
>>
>> or better without the unnecessary ():
>>
>> <% response.write session("levelAcc") %>
>>
>> or:
>>
>> <% = session("levelAcc") %>


[please do not quote signatures on usenet]

>
> sherlock, it's not working. None of the 3 work. I've even assigned
> session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
> tried session("levelAcc") ="test", and it doesnt display .


Oh yes, they work, you must make a mistake wat you are not telling.

Like your browser having the session cookies switched off or not using an
ASP enabled server.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
 
Reply With Quote
 
.Net Sports
Guest
Posts: n/a
 
      07-06-2009

>
> > sherlock, it's not working. None of the 3 work. I've even assigned
> > session("levelAcc") a hardcoded value : *session("levelAcc") = 1, and
> > tried session("levelAcc") ="test", and it doesnt display .

>
> Oh yes, they work, you must make a mistake wat you are not telling.
>
> Like your browser having the session cookies switched off or not using an
> ASP enabled server.
>


sherlock, thanks for helping...no, the cookies and server is good, on
this page in question when i do this: <%= request.querystring
("level") %> from a querystring, it works. Just wondering what's
stopping this session object not to display
 
Reply With Quote
 
Bob Barrows
Guest
Posts: n/a
 
      07-06-2009

..Net Sports wrote:
>>> sherlock, it's not working. None of the 3 work. I've even assigned
>>> session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
>>> tried session("levelAcc") ="test", and it doesnt display .


Wait a minute. Be more explicit please. Are you saying you have tried this?
<%
session("levelAcc") ="test"
Response.Write session("levelAcc")
%.

Or are you talking about setting the session variable value on one page and
attempting to display it on another? If so, at least make sure the above
test page successfully displays the word "test" when run.

>>
>> Oh yes, they work, you must make a mistake wat you are not telling.
>>
>> Like your browser having the session cookies switched off or not
>> using an ASP enabled server.
>>

>
> sherlock, thanks for helping...no, the cookies and server is good, on
> this page in question when i do this: <%= request.querystring
> ("level") %> from a querystring, it works.


That proves nothing. The querystring does not rely on cookies - it is just
taken from the url. Check out these articles
http://classicasp.aspfaq.com/general...les-stick.html
http://classicasp.aspfaq.com/general...disappear.html

Make sure you have created an application for your website in IIS Manager


--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
.Net Sports
Guest
Posts: n/a
 
      07-07-2009
On Jul 6, 11:55*am, "Bob Barrows" <(E-Mail Removed)> wrote:
> .Net Sports wrote:
> >>> sherlock, it's not working. None of the 3 work. I've even assigned
> >>> session("levelAcc") a hardcoded value : session("levelAcc") = 1, and
> >>> tried session("levelAcc") ="test", and it doesnt display .

>
> Wait a minute. Be more explicit please. Are you saying you have tried this?
> <%
> session("levelAcc") ="test"
> Response.Write session("levelAcc")
> %.
>
> Or are you talking about setting the session variable value on one page and
> attempting to display it on another? If so, at least make sure the above
> test page successfully displays the word "test" when run.
>
>
>
> >> Oh yes, they work, you must make a mistake wat you are not telling.

>
> >> Like your browser having the session cookies switched off or not
> >> using an ASP enabled server.

>
> > sherlock, thanks for helping...no, the cookies and server is good, on
> > this page in question when i do this: *<%= request.querystring
> > ("level") %> from a querystring, it works.

>
> That proves nothing. The querystring does not rely on cookies - it is just
> taken from the url. Check out these articleshttp://classicasp.aspfaq.com/general/why-won-t-my-session-variables-s...http://classicasp.aspfaq.com/general...application-va...
>
> Make sure *you have created an application for your website in IIS Manager
>
> --
> Microsoft MVP - ASP/ASP.NET - 2004-2007
> Please reply to the newsgroup. This email account is my spam trap so I
> don't check it very often. If you must reply off-line, then remove the
> "NO SPAM"


OK, I was establishing the session object after a redirect to the
landingpage, so it wasn't reading it...i made sure the directory live
was set as an application...now everything works, thanx!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
displaying session value in formview? xbound ASP .Net 1 05-19-2010 12:54 AM
Stored Session object is mixed up with another user's session object. momo898 ASP .Net 2 10-12-2006 03:33 PM
Re: displaying current session value requires 2nd postback Jon Paal ASP .Net 2 03-17-2006 06:47 PM
Displaying the all the name-value pairs of the session object? =?Utf-8?B?RGlmZmlkZW50?= ASP .Net 3 05-12-2005 11:54 PM
How do I fix "Argument not specified for parameter 'value' of 'Public Overridable Sub Add(key As Object, value As Object)" Chuck Insight ASP .Net Web Controls 2 03-19-2005 12:03 AM



Advertisments