Results 1 to 4 of 4

Thread: Problem with USER.Identity.name in ASP.net

  1. #1
    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""

  2. #2
    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.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    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>

  4. #4
    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.

Similar Threads

  1. Transferring Identity safe Logins To Windows User Profile
    By Punker in forum Networking & Security
    Replies: 4
    Last Post: 27-12-2010, 02:55 AM
  2. ASP Net this.user.identity.name
    By Zeverto in forum Software Development
    Replies: 3
    Last Post: 29-07-2009, 12:07 PM
  3. net user username password problem
    By Banjiji in forum Networking & Security
    Replies: 3
    Last Post: 28-07-2009, 07:21 PM
  4. Problem with ASP.NET user account
    By samit in forum Operating Systems
    Replies: 4
    Last Post: 05-06-2009, 07:04 AM
  5. Replies: 0
    Last Post: 07-01-2009, 09:18 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,556,750.04830 seconds with 17 queries