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 4043208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:05:57+00:00 2026-05-20T13:05:57+00:00

I am using an email address as my username for Login. When a user

  • 0

I am using an email address as my “username” for Login. When a user logs in the User object that is created has the Email address as the name which is incorrect. The actual name is another field in the DB. How do I login and authenticate against the email address and then load the correct name in the User object?

I am using forms authentication with a custom MembershipProvider and RoleProvider.

Edits Below to Clarify

I have a custom MembershipProvider that validates users by email address and password. It is called by the basic Login Control and registered in web.config.

<asp:Login ID="AdminLogin" runat="server" MembershipProvider="AdminMembershipProvider">
</asp:Login>

Web.Config:

<authentication mode="Forms">
        <forms loginUrl="Default.aspx" />
    </authentication>
    <membership defaultProvider="AdminMembershipProvider">
      <providers>
        <clear />
        <add name="AdminMembershipProvider"
             type="AdminMembershipProvider"
             connectionStringName="EvalSysConnectionString"
             />

      </providers>
    </membership>

With just this my users are logged in correctly. However it returns a Context.User.Identity.Name of the email address. I have the first name and last name stored in the DB and want this to be the Name.

I read various posts that seem to indicate that I would have to create a Global.asax file and override the PostAutheticateRequest method to do this. However I have no idea how to proceed with this strategy.

<%@ Application Language="C#" %>

<script runat="server">

    protected void Application_PostAuthenticateRequest()
    {
        string test = HttpContext.Current.User.ToString();
    }

</script>

I’m sorry my question was so vague. I’m so lost with this that I don’t know how to write a good question.

  • 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-20T13:05:58+00:00Added an answer on May 20, 2026 at 1:05 pm

    I would do exactly what you have done so far and then store the users name, address and so on in the Profile object.

    This is as easy as adding some configuration (web.config):

    <profile>
      <providers>
        <clear />
        <add name="SqlProvider"
          type="System.Web.Profile.SqlProfileProvider"
          connectionStringName="SqlServices"
          applicationName="SampleApplication"
          description="SqlProfileProvider for SampleApplication" />
      </providers>
      <properties>
        <add name="Name" />
      </properties>
    </profile>
    

    And then retrieve/set it like so:

    txtName.Text = Profile.Name;
    Profile.Name = txtName.Text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to retrieve all the email gruops and their mail address from
I am using Flex 4. I have created an image gallery with TileList When
I am using jQuery Templates successfully but I have a blur function that is
i'm using forms based authentication within my aspnet (c#) website. At the log in
I have an array multidimensional associative array. Array ( [0] => Array ( [username]
I'm trying to get the height of the error container when using 'jquery validate'
I am using AspNetSqlMembershipProvider in my ASP .Net 4 web application project. I have
I have a basic app using the ASP.NET membership provider. By default, you can
I'm using jquery validation on a form with a text area. The html in
I am looking for validation using jquery on a simple form and I want

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.