I am using C# MVC using .NET 4.0
I am trying to implement the ASP.NET Profile Properties seen at
http://msdn.microsoft.com/en-us/library/2y3fs9xs.aspx
First, I added the following in my web.config file. Note that I am trying to store the Location for a given user:
<profile>
<properties>
<add name="Location" />
</properties>
<providers>
<clear />
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/" />
</providers>
</profile>
Within my code, I used the following:
After I post, I used the following my in controller:
Profile.Location = model.Location;
I am getting an error, Cannot resolve ‘Profile’. Has anybody used the Profile Property that can offer any assistance? Note that I wasn’t even able to find the class that is mentioned in the article.
Thanks
A profile would have to belong to a User/Member so you would have to load or create a new User before adding any profile properties to it.
See this SO post on a similar question