IM目前正試圖現在幾天就實施我的網站的個人資料提供者,有一個很難做這個工作,我是一個PHP程序設計師,我只是使用LINQ to SQL的轉向asp.net最近在ASP.net MVC中使用自定義配置文件提供程序?
林,並按照這個http://www.codeproject.com/KB/aspnet/LINQCustomProfileProvider.aspx教程。
即時通訊使用我自己的原因,因爲我有不同的結構比任何默認的asp.net有。配置文件數據在我的用戶表中。
編譯很好,登錄很好。
但我想
<% CMSProfile profile = HttpContext.Current.Profile as CMSProfile;%>
<%= profile.NickName %>
將無法正常工作,並拋出我System.NullReferenceException ......我 怎麼能自動獲得我的個人資料到HttpContext的,這樣我可以輕鬆地每次召喚出來。
如果您需要更多數據,我可以提供。
非常感謝。
Web.config文件:
<roleManager enabled="false" defaultProvider="CMSRoleProvider">
<providers>
<clear />
<add name="CMSRoleProvider" type="P014.ProviderClass.CMSRoleProvider" connectionStringName="P014ConnectionString" applicationName="/" />
</providers>
</roleManager>
我已經將web.config添加到了我的帖子中。你可以請退房 – DucDigital 2009-11-11 03:52:39