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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:28:28+00:00 2026-05-27T03:28:28+00:00

For my ASP.NET MVC 3 app (using Razor) my web.config has this: <profile> <providers>

  • 0

For my ASP.NET MVC 3 app (using Razor) my web.config has this:

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

It is my understanding from reading the docs that ASP.NET will automatically generate properties off the HttpContext so that I can access these like this:

 // MyController.cs

 Email = u.Email;
 FirstName = HttpContext.Profile.FirstName;
 LasttName = HttpContext.Profile.LastName;

However, the compiler is bitching that .FirstName and .LastName don’t exist.

What is going on here?

  • 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-27T03:28:29+00:00Added an answer on May 27, 2026 at 3:28 am

    Try this approach:

    1. Create a class (name it UserProfile for example) extending ProfileBase
    2. Add your public properties Email etc (don’t forget {get;set;})
    3. Change your Web.config like the following (change the inherits to your namespace)
    4. You should be able to access it now via (UserProfile)HttpContext.Current.Profile

    Your Web.config:

    <profile defaultProvider="AspNetSqlProfileProvider" inherits="Namespace.To.Your.UserProfile">
        <providers>
            <clear/>
            <add name="AspNetSqlProfileProvider" connectionStringName="ConnectionStringName" type="System.Web.Profile.SqlProfileProvider" applicationName="App" />
        </providers>
    </profile>
    

    Your profile class:

    public class UserProfile : ProfileBase
    {
        public string Email
        {
            get { return (string)GetPropertyValue("Email"); }
            set { SetPropertyValue("Email", value); }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my ASP.net MVC App (using Razor views) I have a ProductDetails view. This
My team is considering building our next web app using the ASP.NET MVC framework.
i am using the sample asp.net mvc app and i want to add specific
I am currently writing a small web app using Asp.net MVC and jQuery mobile.
I'm developing an web app using asp.net mvc. I have a List in Cache
I'm trying to build a planner web app using ASP.NET MVC 3. One of
Does anyone have an experience with developing a big web app using ASP.NET MVC
I'm debugging my ASP.NET MVC 3 web app using Google Chrome Developer Tools, and
I'm building a web app using EF Code First and ASP.NET MVC. I have
I deployed an ASP.NET MVC app using MSDeploy and ran into this problem i

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.