Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6587015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:51:51+00:00 2026-05-25T16:51:51+00:00

I have a small problem, I have an application which used to work perfectly

  • 0

I have a small problem, I have an application which used to work perfectly locally. The authentication was being done from a system I built myself, it was basically using the username of the logged in user, but when deploying on the server I ran into a problem because it was using the servers username instead of the user which is trying to access it.

This was the code which was working, but now it’s not on the server:

    public static string GetUser()
    {
        WindowsIdentity curIdentity = WindowsIdentity.GetCurrent();
        WindowsPrincipal myPrincipal = new WindowsPrincipal(curIdentity);
        return curIdentity.Name;
    }

However I can see that this code:

     <LoggedInTemplate>
        <span class="alignLeft">
           <asp:LoginName ID="HeadLoginName" runat="server"/>
        </span>
        <span class="alignRight">
           <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Logout.aspx"/>
        </span>
     </LoggedInTemplate>

, still used to good login of the user and not the server. I am now trying to get the value of that user, but I am having problems to do that.

All I need to do is to get that in a string.

loginName.Text = HeadLoginName.ToString().Substring(6);

This only returned: “.Web.UI.WebControls.LoginName”. I need the substring to remove the domain name before the user.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:51:52+00:00Added an answer on May 25, 2026 at 4:51 pm

    use

    User.Identity.Name
    

    instead of HeadLoginName function.

    loginName.Text = User.Identity.Name;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small application which reads from a Oracle 9i database and sends
I have small problem with my .net 2.0 winforms application. I want to embed
I have a small problem with UINavigationController animation between two view. My application build
I've got a small Cocoa problem. I have a StatusBar application that has an
I have a Windows Form Application in which clicking certain buttons create objects from
At my work we recently finished the system architecture for a control application which
I have a small C# ASP.NET web application which generates several PNG image files
I'm developing a small application which requires adding user-defined values to a grid. Problem
I want to globalize my application. I have created a small form which asks
I have an Android application in which I'm trying to parse a small sized

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.