473,473 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

HOWTO: Refer to LoginStatus control contents in the LoginView cont

How do you get a reference to the LoginStatus control contained in the
LoginView control that resides on web.master?

I need to determine if the LoginStatus will show a LogOut link(for a logged
in user), or show nothing at all (in the case of the user not logged in);

Are there any other Membership properties that I can call that tell if the
user has already authenticated.?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 24 '06 #1
3 2503
Dan,
Isn't there an IsAuthenticated property on the User object?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Dan Sikorsky" wrote:
How do you get a reference to the LoginStatus control contained in the
LoginView control that resides on web.master?

I need to determine if the LoginStatus will show a LogOut link(for a logged
in user), or show nothing at all (in the case of the user not logged in);

Are there any other Membership properties that I can call that tell if the
user has already authenticated.?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 24 '06 #2
Thanks. I don't know how I overlooked that.

The purpose for trying to do this is to declare Windows Authentication on
IIS Directory Security in order to get Request.ServerVariables("LOGON_USER")
to pass the NT Login Name, and to declare Forms Authentication in the website
web.config file in order to use the Membership functionality that's built in.
The last piece to figure out is to allow a NT Logged In user to not have to
enter a user name and password to get to the site; they've already logged in
to their workstation when they came to work in the morning.

The Login Control on Login.aspx has style="display:none" and I immediately
do a client-side javascript Login button click which fires the OnAuthenticate
event where I can set e.Authenticated to true - this sets up all the
background authentication. On the initial visit to the site, I do a
Membership.CreateUser (I have the username from
Request.ServerVariables("LOGON_USER") from which I can also build an email
address, and can set everyone's password to a constant), and a
Roles.AddUserToRole, and persist the authentication cookie. Subsequent visits
bypass the Login.aspx due to the auth cookie and go directly to the Home page.

.... a lot of rigmarole to get an effect.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Peter Bromberg [C# MVP]" wrote:
Dan,
Isn't there an IsAuthenticated property on the User object?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Dan Sikorsky" wrote:
How do you get a reference to the LoginStatus control contained in the
LoginView control that resides on web.master?

I need to determine if the LoginStatus will show a LogOut link(for a logged
in user), or show nothing at all (in the case of the user not logged in);

Are there any other Membership properties that I can call that tell if the
user has already authenticated.?

--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
Jul 25 '06 #3
Dan,
It sounds like you just want Windows authentication, which can be handled
automatically in the web.config. Check MSDN for details.
Pete

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Dan Sikorsky" wrote:
Thanks. I don't know how I overlooked that.

The purpose for trying to do this is to declare Windows Authentication on
IIS Directory Security in order to get Request.ServerVariables("LOGON_USER")
to pass the NT Login Name, and to declare Forms Authentication in the website
web.config file in order to use the Membership functionality that's built in.
The last piece to figure out is to allow a NT Logged In user to not have to
enter a user name and password to get to the site; they've already logged in
to their workstation when they came to work in the morning.

The Login Control on Login.aspx has style="display:none" and I immediately
do a client-side javascript Login button click which fires the OnAuthenticate
event where I can set e.Authenticated to true - this sets up all the
background authentication. On the initial visit to the site, I do a
Membership.CreateUser (I have the username from
Request.ServerVariables("LOGON_USER") from which I can also build an email
address, and can set everyone's password to a constant), and a
Roles.AddUserToRole, and persist the authentication cookie. Subsequent visits
bypass the Login.aspx due to the auth cookie and go directly to the Home page.

... a lot of rigmarole to get an effect.
--
Thank you kindly,

Dan Sikorsky BA, BSCE, MCS
"Peter Bromberg [C# MVP]" wrote:
Dan,
Isn't there an IsAuthenticated property on the User object?
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Dan Sikorsky" wrote:
How do you get a reference to the LoginStatus control contained in the
LoginView control that resides on web.master?
>
I need to determine if the LoginStatus will show a LogOut link(for a logged
in user), or show nothing at all (in the case of the user not logged in);
>
Are there any other Membership properties that I can call that tell if the
user has already authenticated.?
>
--
Thank you kindly,
>
Dan Sikorsky BA, BSCE, MCS
Jul 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: clintonG | last post by:
The LoginStatus control does not have a click event. If anybody is at all familiar with this control and can explain how to create a click event I'm ready to learn something new. <%= Clinton...
0
by: AR | last post by:
I am interested in the best approach for placing a LoginStatus control in a Master page. The reason I'm doing this is so I can always display the "Login" or "logout" link at the top of every page...
1
by: frolda | last post by:
Hi, I moved my login.aspx page from root to a subdirectory and made -hopefully- all necessary changes for all Login controls. All the controls work just fine, except one. To my regret, the...
7
by: Buck Rogers | last post by:
Hi all! Newbie here. Below is an example from Teach Yourself C in 21 Days. My apologies if it is a bit long. What I don't understand is how the "get_data" function can call the...
0
by: pbaugh | last post by:
Hi Folks, I'm using the ASP.NET 2.0 LoginStatus control and am having a frustrating time! I created a basic testbed web site added the control to the default page, added a login.aspx page with a...
2
by: Jeff | last post by:
hey asp.net 2.0 I've placed a LoginStatus control on a master page (so I don't need to have it on every webpage) in my project. When I click on this control to logout, I get this error: A...
0
by: clintonG | last post by:
Apparently there is no click event handler where I can get some stuff done when the user clicks a LoginView control to get logged in. Is there some way to do so? -- <%= Clinton Gallagher NET...
2
by: jsqrd | last post by:
Can anyone tell me me if the two subject controls work when using a SQL Server database as opposed to a SQL Server Express instance? If so, what's the trick to making it work? I have the role...
0
by: helveticus | last post by:
I am struggling to allow a LoginStatus control reflect its changed state when embedded in a cached page. All pages in my app share a common login user control that basically consists of a...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
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...
1
isladogs
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.