|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Deriving from MembershipUser and ASPNET Config ToolI'm reposting this in case it got lost...
The ASPNET Configuration tool does not appear to be able to handle derived MembershipUser classes. Even the simplest possible derived class (one which merely wraps MembershipUser itself, duplicates its public constructor but adds no additional methods or properties) causes ASPNET Configuration to blow up. The error message indicates that ASPNET Configuration cannot load the derived Type from the website's dynamically-created assembly (i.e., the derived MembershipUser class is in the site's AppCode folder). The same problem occurs if the derived MembershipUser class is housed in a class library referenced by the site. Have others run into this problem? Better yet, have others created derived MembershipUser classes which operate with the ASPNET Configuration tool? - Mark Hello Mark,
In ASPNET Configuration, ew can create and manage user with form authentication. However, I am not very clear about what you want this tool to handle derived MembershipUser classes. Can you explain more on this and provide a reproducable sample on this issue, including the source code of the class inherits from MembershipUser and how you use it in a project? Regards, Luke Luke,
To reproduce the problem, take a custom MembershipProvider and modify CreateUser() to return a custom MembershipUser object. The derived MembershipUser class doesn't even need to implement any new functionality; you can just make it a "wrapper" around the base MembershipUser class, duplicating the public constructor. Register the provider in the web.config file, and then run the ASPNET Configuration tool for the site. Try to create a new user. On my system, it throws an exception (which the Configuration tool captures, but which stops it from processing). What I want to be able to do is use a derived MembershipUser class to "store" extended user information. I don't expect the ASPNET Configuration tool to display that information, or let me edit it. I just want to be able to create users with the Configuration tool and a custom MembershipUser class. - Mark Hello Mark,
You may check the web.config file to see if your provider has been set to defaultProvider, and if its type name is correct. Here is a sample provider, you may first test it on your system to see if it can work: http://www.devx.com/asp/Article/29256?type=kbSampleProd&trk=MSCP Luke Luke,
My custom MembershipProvider is properly registered and accessible from the website application. That's not the problem. Can you please confirm for me whether or not derived MembershipUser classes actually work with the ASPNET Configuration tool? - Mark Yes, I can confirm. Below is sample which can have
"AccessMembershipProvider" display in the configration tool: <membership defaultProvider="AccessMembershipProvider" > <providers> <remove name="AspNetSqlMembershipProvider" /> <add name="AccessMembershipProvider" type="AccessMembershipProvider" requiresQuestionAndAnswer="true" connectionStringName="AccConn" /> </providers> </membership> <roleManager defaultProvider="AccessMembershipProvider"> <providers> <add name="AccessMembershipProvider" type="System.Web.Security.AccessRoleProvider, System.Web, Version=1.1.3300.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="AccConn" /> </providers> </roleManager> One thing needs to be mentioned is that we also need a role Provider here. Hope this help, Luke I know you need to define a custom MembershipProvider. I've done that! It works great!
What doesn't work is a custom MembershipUser class returned by a custom MembershipProvider. That's what I'd like to know if it's possible. - Mark The problem may be related to the provider you create. Can you send me your
test project to me? I may study it to see if I can find anything wrong. (To get my actual email, please remove 'online' ) Luke Zhang Luke,
I just sent you an email. Please let me know when you get it. - Mark
Other interesting topics
global functions?
ASP.net and thread safety MSWord Common functionality across pages, what's the best solution? Asp.net 2.0 caching and images DataGrid, Edit and the Enter Key Dot Net or Javascript problem??? ASP.NET Embedded Resources Very Strange Problem! (Derived Controls) - Help! Architectural assistance needed! |
|||||||||||||||||||||||