I've added custom field in web.config and created ProfileCommon class .
namespace ProjectName.Web
{
public class ProfileCommon : ProfileBase
{
public static System.String Phone
{
get { return HttpContext.Current.Profile.GetPropertyValue("Phone") as System.String; }
set { HttpContext.Current.Profile.SetPropertyValue("Phone", value); }
}
}
}
Change in web.config :
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider" >
<providers>
<remove name="AspNetSqlProfileProvider" />
<add name="AspNetSqlProfileProvider" connectionStringName="LocalSqlServer" applicationName="MonoX" type="System.Web.Profile.SqlProfileProvider" />
</providers>
<properties>
<add name="Phone" type="System.String" />
</properties>
</profile>
But i get the following error :
The type or namespace name 'ProfileCommon' could not be found (are you missing a using directive or an assembly reference?)
Please tell me where I'm wrong?
This content has not been rated yet.
25
Reputation
3
Total posts