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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:03:25+00:00 2026-06-13T08:03:25+00:00

Asp.net profile is either not displaying or saving the data the user enters, However

  • 0

Asp.net profile is either not displaying or saving the data the user enters, However there is No Errors. here is a view of the code below: the webproject just Runs and nothing is displayed on both firstname amd lastname label.

This is A WEB PROJECT ,,, I opened the project using OPEN WEBSITE!

HOWEVER the Project Displays it as “WEBPROJECT.sln(3)” at the program title bar of VISUAL STUDIOS.

This is when the user creates the account and saves the users profile settings: NEW AND UPDATED

protected void CreateUserWizard_CreatedUser(object sender, EventArgs e)
{
    // Create an empty Profile for the newly created user
    ProfileCommon p = (ProfileCommon)ProfileCommon.Create(RegisterUser.UserName, true);

    // Save profile - must be done since we explicitly created it

    TextBox txtNewFirstName = (TextBox)RegisterUser.FindControl("txtNewFirstName");
    Profile.FirstName = txtNewFirstName.Text;


    TextBox txtNewLastName = (TextBox)RegisterUser.FindControl("txtNewLastName");
    Profile.LastName = txtNewLastName.Text;


    p.Save();
}

And this is when its is displayed: NEW AND UPDATED

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
    if (!this.IsPostBack)
    {
            ProfileCommon p = this.Profile.GetProfile(this.User.Identity.Name);

            Label firstName = (Label)LoginView1.FindControl("firstName");
           Profile.FirstName = firstName.Text;


            Label lastName = (Label)LoginView1.FindControl("lastName");
           Profile.LastName = lastName.Text;


    } 
}

And this is the Web config: NEW AND UPDATED

 <profile defaultProvider="AspNetSqlProfileProvider" enabled="true">
  <properties>
    <add name="FirstName" type="String" serializeAs="String"/>
    <add name="LastName" type="String" serializeAs="String"/>
    <add name="Gender" type="String" serializeAs="String"/>
    <add name="BirthDate" type="DateTime" serializeAs="String"/>
    <add name="Occupation" type="String" serializeAs="String"/>
    <add name="Website" type="String" serializeAs="String"/>
    <group name="Forum">
      <add name="Posts" type="Int32" defaultValue="0"/>
      <add name="AvatarUrl" type="String" serializeAs="String"/>
      <add name="Signature" type="String" serializeAs="String"/>
    </group>
    <group name="Address">
      <add name="Street" type="String" serializeAs="String"/>
      <add name="PostalCode" type="String" serializeAs="String"/>
      <add name="City" type="String" serializeAs="String"/>
      <add name="State" type="String" serializeAs="String"/>
      <add name="Country" type="String" serializeAs="String"/>
    </group>
    <group name="Contacts">
      <add name="Phone" type="String" serializeAs="String"/>
      <add name="Fax" type="String" serializeAs="String"/>
    </group>
  </properties>

  <providers>
 <clear/>
    <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
  </providers>
</profile>

This is Whats being displayed on the aspnet_Profile on my sql server:

[PropertyNames]

[LastName:S:0:0:FirstName:S:0:0:]

This is redone of the previous code so please ignore previous comments below!

I have also Tryed PreRender Method:

<script runat="server">
protected void Page_PreRender(object sender, EventArgs e)
{
            ProfileCommon p = this.Profile.GetProfile(this.User.Identity.Name);

            Label firstName = (Label)LoginView1.FindControl("firstName");
           Profile.FirstName = firstName.Text;


            Label lastName = (Label)LoginView1.FindControl("lastName");
           Profile.LastName = lastName.Text;

}

But i get a error: Object reference not set to an instance of an object. for Profile.FirstName = firstName.Text;

  • 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-06-13T08:03:25+00:00Added an answer on June 13, 2026 at 8:03 am

    Simplify it by removing all properties from Web.Config except for the first and last name properties. Try to narrow it down.

    The following works for me. Although I set anonymousIdentification to true for convenience, I’ve given you the full syntax for a working membership Web.Config entry:

    <configuration>
      <connectionStrings>
        <remove name="LocalSqlServer"/>
        <add name="LocalSqlServer" 
            connectionString="Initial Catalog=Test;Data Source=MYPCNAME;Integrated Security=SSPI;" providerName="System.Data.SqlClient"/>
      </connectionStrings>
      <system.web>
        <anonymousIdentification enabled="true"/>
        <profile>
          <properties>
            <add name="FirstName" type="System.String" allowAnonymous="true"/>
            <add name="LastName" type="System.String" allowAnonymous="true"/>
          </properties>
        </profile>
        <roleManager enabled="true"/>
        <authentication mode="Forms">
          <forms timeout="50000000"/>
        </authentication>
        <membership defaultProvider="SqlProvider">
          <providers>
            <clear/>
            <add name="SqlProvider" 
                type="System.Web.Security.SqlMembershipProvider"
                connectionStringName="LocalSqlServer" 
                enablePasswordReset="true" 
                requiresQuestionAndAnswer="false" 
                requiresUniqueEmail="false" 
                maxInvalidPasswordAttempts="5" 
                passwordAttemptWindow="10" 
                passwordFormat="Hashed" 
                minRequiredPasswordLength="7" 
                minRequiredNonAlphanumericCharacters="0" 
                passwordStrengthReqularExpression="0" 
                enablePasswordRetrieval="false" 
                applicationName="/"/>
          </providers>
        </membership>
        <compilation debug="true" targetFramework="4.0"/>
      </system.web>
    </configuration>
    
        protected void Button1_Click(object sender, EventArgs e)
        {
            ProfileCommon p = (ProfileCommon)ProfileCommon.Create(fnTxt.Text 
                + lnTxt.Text, true);
            Profile.FirstName = fnTxt.Text;
            Profile.LastName = lnTxt.Text;
    
            p.Save();
        }
    
        protected void Page_PreRender(object sender, EventArgs e)
        {
            resultLabel.Text = Profile.FirstName + " " + Profile.LastName;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if there is a good example of how to edit ASP.NET Profile
Profile that is used for ASP.NET Profile Service is not available in Page code
In asp.net Webforms apps, is there not any kind of maintenance UI page to
I cerated a asp.net user profile with 1 property List<string> Password it contain 24
I am working on designing a user profile web page in asp.net using c#.
Using asp.net mvc, a user updates his profile. This is how my update action
Is there any tool that will inspect either asp.net or sql server and report
Is there any way of storing a generic dictionary object in an asp.net profile?
When you create profile information for an asp.net user, it creates all the property
I just discovered ASP.net uses its own profile system to register users and there

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.