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

  • SEARCH
  • Home
  • 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

So I've got a user model, with login, email address, password, password confirmation, name,
A user logins into the SharePoint site we have created using their email address
How can I send an email using SYstem.Net.Mail to an email address that is
Using MS - Access 2003 Table S.No Details 1 name 2 address 3 email
I am using Oracle.Web.Security.OracleMembershipProvider MembershipProvider for my ASP.NET application. My login form has username,
I have following code which successfully sent email using Gmail address. But when i
I have a contact us form, whereby the user enters his name,email address and
Trying to use a php generating the email address using the ID eg: peopleID
Duplicate : Using a regular expression to validate an email address There seem to
I'm using Apache Commons e-mail validator and it refuses to accept email address like:

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.