Hello,
I have created a class that inherits MembershipUser:
public class UserHelper : MembershipUser {
....
Then I am creating a user as follows:
UserHelper user = (UserHelper)Mem bership.CreateU ser("me", "pass",
"me@domain.com" , null, null, true, null, out status);
Membership.Crea teUser returns a MembershipUser
But I get an error:
Unable to cast object of type 'System.Web.Sec urity.Membershi pUser' to
type 'MyApp.Security .Membership.Use rHelper'.
If I don't cast it, which means, using:
UserHelper user = Membership.Crea teUser("me", "pass", "me@domain.com" ,
null, null, true, null, out status);
It does not compile and I get the error:
Cannot implicitly convert type 'System.Web.Sec urity.Membershi pUser' to
'MyApp.Security .Membership.Use rHelper'. An explicit conversion exists
(are you missing a cast?)
What am I doing wrong?
Thanks,
Miguel
I have created a class that inherits MembershipUser:
public class UserHelper : MembershipUser {
....
Then I am creating a user as follows:
UserHelper user = (UserHelper)Mem bership.CreateU ser("me", "pass",
"me@domain.com" , null, null, true, null, out status);
Membership.Crea teUser returns a MembershipUser
But I get an error:
Unable to cast object of type 'System.Web.Sec urity.Membershi pUser' to
type 'MyApp.Security .Membership.Use rHelper'.
If I don't cast it, which means, using:
UserHelper user = Membership.Crea teUser("me", "pass", "me@domain.com" ,
null, null, true, null, out status);
It does not compile and I get the error:
Cannot implicitly convert type 'System.Web.Sec urity.Membershi pUser' to
'MyApp.Security .Membership.Use rHelper'. An explicit conversion exists
(are you missing a cast?)
What am I doing wrong?
Thanks,
Miguel
Comment