Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 16-07-2009
Member
 
Join Date: May 2008
Posts: 29
Problem with USER.Identity.name in ASP.net

I know that inn Asp.Net using this "USER.Identity.name" code we can get user logon name.I want to know the exact functioning of this code:
Can anyone here help me since I don't see any output I am getting to know the username.
Is there any setting I must do to get the username on localhost in the IIS?


this.user.identity.name""
Reply With Quote
  #2  
Old 16-07-2009
Member
 
Join Date: Oct 2008
Posts: 37
Re: Problem with USER.Identity.name in ASP.net

I have a question about the Username. Is it true that all users log in with username@domain_name structure? If yes then I wnat to know How this.User.Identity.Name gives the name as we have logged in as? may be its a very simple question but still I want to know this.
Reply With Quote
  #3  
Old 16-07-2009
Member
 
Join Date: Jan 2008
Posts: 1,515
Re: Problem with USER.Identity.name in ASP.net

Try this for VB.Net:
User.Identity.Name

Code:
<%@ Page Language="vb" %>
<html>
   <head>
      <title>User property example</title>
      <script runat="server">
         Sub Page_Load()
            Message.Text = "Authenticated: " & User.Identity.IsAuthenticated & "<br/>"
            Message.Text &= "User Name: " & User.Identity.Name
         End Sub
      </script>
   </head>
<body>
   <asp:label id="Message" runat="server"/>
</body>
</html>
For ASP.net

Code:
<%@ Page Language="vb" %>
<html>
   <head>
      <title>Displaying the authentication status in ASP.NET</title>
   </head>
<body>

<p>

<%
   Dim boolAuth As Boolean

   boolAuth = Request.IsAuthenticated

   If boolAuth Then
      Response.Write("User " & Page.User.Identity.Name & " is authenticated.")
   Else
      Response.Write("Current user is not authenticated.")
   End If
%>

</p>

</body>
</html>
Reply With Quote
  #4  
Old 16-07-2009
Member
 
Join Date: Oct 2008
Posts: 116
Re: Problem with USER.Identity.name in ASP.net

ASP.NET Request Identity

ASP.Net supports the following authentication modes, None, Windows and Forms. None as it's name implies does not perform any type of authentication and runs under the default identity. Windows supports both basic and integrated authentication. Forms supports the ASP.Net forms authentication.
As part of the ASP.Net request life cycle, we can capture the AuthenticateRequest event when a request is received. This event always fires and is raised by the Application. It can be handled in the Global.asax. This event is also handy for capturing the actual user's identity and replacing the users principal with our own.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Problem with USER.Identity.name in ASP.net"
Thread Thread Starter Forum Replies Last Post
Transferring Identity safe Logins To Windows User Profile Punker Networking & Security 4 27-12-2010 02:55 AM
ASP Net this.user.identity.name Zeverto Software Development 3 29-07-2009 12:07 PM
net user username password problem Banjiji Networking & Security 3 28-07-2009 07:21 PM
Problem with ASP.NET user account samit Operating Systems 4 05-06-2009 07:04 AM
Transfer user settings to another user - Duplicate user's account (Windows Vista) TheGreatOne Tips & Tweaks 0 07-01-2009 09:18 PM


All times are GMT +5.5. The time now is 10:41 AM.