im currently trying to implement a profile provider for my site a few days now and having a hard time working on it, im a php programer and i just shift to asp.net recently
Im using Linq to sql and follow this http://www.codeproject.com/KB/aspnet/LINQCustomProfileProvider.aspx tutorial.
the reason im using my own because i having different structure than any default of asp.net have. The profile data is inside my user table.
The compile was fine, login was fine.
but i tried
<% CMSProfile profile = HttpContext.Current.Profile as CMSProfile;%>
<%= profile.NickName %>
it won't work and throw me a System.NullReferenceException... so how can i automatically get my Profile into the HTTPCONtext so that i can call out easily everytime.
If you need any more data, i can provide.
Thank you very much.
Web.config:
<roleManager enabled="false" defaultProvider="CMSRoleProvider">
<providers>
<clear />
<add name="CMSRoleProvider" type="P014.ProviderClass.CMSRoleProvider" connectionStringName="P014ConnectionString" applicationName="/" />
</providers>
</roleManager>
How have you registered the provider in web.config? You shouldn't have to instantiate the provider yourself it should be done by the app at startup. If you give more info I might be able to help.
EDIT: Here is my web.config, maybe it will be of help to you.