Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 22nd, 2003, 09:06 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Context.User.Identity.Name

Hi,

I am setting up an Intranet web site. I want to add the windows login name for those people who update records, but the "Context.User.Identity.Name" is showing up empty.

Can someone tell the steps I need to take to make this possible.

Thanks
sjp
 
Old August 22nd, 2003, 09:16 AM
Registered User
 
Join Date: Jun 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I found the answer - I needed to uncheck the [u]Anonymous access </u>in the IIS Directory Security.
 
Old November 8th, 2003, 12:08 PM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to GeorgeMike
Default

Quote:
quote:Originally posted by sjlsysprg1
 I found the answer - I needed to uncheck the [u]Anonymous access </u>in the IIS Directory Security.

How can I get the username which in my database using Context.User.Identity.Name?
Everytime I logged in the Context.User.Identity.Name='Local/Administrator' which i dont expect

 
Old November 9th, 2003, 01:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

1st make a page colled login.aspx then after verify & to make user OK u need code like follow:
Code:
FormsAuthentication.SetAuthCookie(UserID, false);
Session.Timeout = 30;
Response.Redirect(Request.QueryString.Get("ReturnUrl"));
of corse u will need to set ur Web.Config file as follow too:
Code:
    <authentication mode="Forms">
      <forms name="logins" loginUrl="login.aspx" protection="All" timeout="20" />
    </authentication>
    <authorization>
      <allow users="t" />
      <deny users="?" />
    </authorization>


HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
User Identity stonesbg ASP.NET 2.0 Basics 1 February 9th, 2007 11:14 AM
Context.User.Identity.Name jimbeam36 BOOK: ASP.NET Website Programming Problem-Design-Solution 4 November 6th, 2004 06:33 AM
(SitePrincipal)Context.User Philey BOOK: ASP.NET Website Programming Problem-Design-Solution 3 October 8th, 2004 05:38 PM
Context User davidroth BOOK: ASP.NET Website Programming Problem-Design-Solution 0 April 14th, 2004 12:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.