I'm attempting to use the context.user object. In my login code, I add
an identity to the context.user. I can use the debugger to watch it
stuff the identity into the context.user object, but when I later try to
check the context.user.identity.name it contains the empty string ("").
Does anyone know why this would be the case?
John 2 1163
John,
The context object is recreated every page load.
Are you trying to use it later in the code, on a different page, or on
postback to the same page?
Sincerely,
--
S. Justin Gengo, MCP
Web Developer
Free code library at: www.aboutfortunate.com
"Out of chaos comes order."
Nietzche
"John Kraft" <jh*****@ilstu.edu> wrote in message
news:bh**********@malachite.ilstu.edu... I'm attempting to use the context.user object. In my login code, I add an identity to the context.user. I can use the debugger to watch it stuff the identity into the context.user object, but when I later try to check the context.user.identity.name it contains the empty string ("").
Does anyone know why this would be the case?
John
John Saunders wrote: "John Kraft" <jh*****@ilstu.edu> wrote in message news:bh**********@malachite.ilstu.edu...
S. Justin Gengo wrote:
John,
The context object is recreated every page load.
Are you trying to use it later in the code, on a different page, or on postback to the same page?
Sincerely,
Well, that would certainly explain it.
Here's the dealio... I am currently using(attempting to use) forms authentication on a site. We have only certain directories which need to have the user log in. What I wanted to do was put a little login box on each page and if the user chose to use the login box, it would carry his credentials with him. Than way, if he later went to one of the directories that required authentication, he would already be authenticated and let in
automatically.
The problem is... I really don't fully understand what I am doing and was trying to mimic the code that I have (copied from some example on the net) in the global asax file in the authenticate_request method.
I strongly suggest you look into Forms Authentication (see "Forms Authentication Provider" at http://msdn.microsoft.com/library/de...lications.asp).
When you do, I also strongly suggest that you first forget everything you know about the technique you were trying to use. Then, once you understand Forms Authentication, you can see how it relates to what you've got now. I've seen too many attempts to twist Forms Authentication into something it wasn't meant to do, rather than learn what it actually does.
Ok... I appreciate you pointing me at that site. I've read it. It
pretty much makes sense, and our forms auth is working as advertised.
Now... to do what I wish to do... in theory... all I should have to do
is authenticate the user myself in my little login box, and then add a
cookie to the system.
Isn't this correct?
Well, it won't let me add a cookie to the system.
Response.cookies.add() doesn't seem to work from my little control.
Argh???
John This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jeff |
last post by:
how do you convert form byte to Int32 while retaining the binary
value of the byte array
|
by: lgbjr |
last post by:
Hello All,
I have several Pictureboxes (linked to an AccessDB) on a VB.NET form. I
would like to use a context menu to allow the user to open the picture in
their default picture viewer or...
|
by: tshad |
last post by:
I am playing with GenericPrincipal classes and am using a sample program to
test it.
The problem is that even though I set the roles (which shows the roles in
the Context.User as being there),...
|
by: brisco5 |
last post by:
I have a TEXTAREA element. A user right clicks within in to get the
context menu and they select "paste". I want my javascript code to
know that they selected "paste".
I know you can capture the...
|
by: Greg Hurlman |
last post by:
I have an HttpModule that captures the
FormsAuthenticationModule.Authenticate event, and replaces the
HttpContext principal with a custom principal. The code is
straightforward enough, yet when...
|
by: s4lin |
last post by:
problem is pagination not retaining data field
i have form with general data field, and i need to select some option which is store in database, so i open another page with retrieving data from...
|
by: qwikstix |
last post by:
I have a right click menu on my page and when I right click but click away instead of choosing an option, I get very weird behavior on the rest of the page. The text input controls are unable to...
|
by: Bels |
last post by:
I am currently designing a real estate website using Dreamweaver CS3, php, MySQL on a Mac. On it is a 'property search' form that queries the property database. The form consists of 5 dropdown lists....
|
by: Anjana Bhat |
last post by:
Hi,
im using asp.net with c#.In my form i have a list of html radio button group in which if i select one,a text box and an image is loaded .This i have done thro. javascript.but in the same page...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |