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.id entity.name it contains the empty string ("").
Does anyone know why this would be the case?
John 2 1186
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.il stu.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.id entity.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.il stu.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(attemptin g 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 authenticatio n, 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_re quest 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.cookie s.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 editor. I'd like to use the same default
viewer/editor and open with... choices that are present on the users
computer.
Does anyone know how I can find this information programatically, so my
picturebox context menu uses the same settings as the...
|
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), when the program goes from the login page
to the next page - the roles in the Context.User is empty.
My Login page is:
*****************************************************************
|
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 mouse click, but can we capture exactly what
event that attempted?
Thanks,
Mike
|
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 an ASPX page tries to get this custom
principal it fails - the object I inserted is not there. I've tried
having this module declaration at both the top & bottom of the list in
my web.config... What am I missing?
The code:
| |
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 table with pagination
form data's are retaining if i select from first page but data not retaining if i select option from other than 1st page. i m using hidden field in pagination page.
Thanks
stalin
|
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 receive focus. It appears that the right click menu is retaining focus even though it has disappeared. Even though I can't see the right click menu, navigating up/down with the keyboard arrows and pressing enter executes options on the now-invisible...
|
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. The first dropdown (buy or let) is a parent list and the 3rd and 4th dropdowns (minimum price and maximum price) are child lists - they are dependent on what is chosen in the 1st dropdown. I have got it working with an onchange event and javascript...
|
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 im uploading another image.that image is displayed on a button click.so the page refreshes and the first image disappears.To retain this i again wrote a javascript on the same button click which tests the checked radio button and loads the text box...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |