Questions tagged [membershipuser]

25 questions
33
votes
3 answers

InvalidCastException: Unable To Cast Objects of type [base] to type [subclass]

I have a custom CustomMembershipUser that inherits from MembershipUser. public class ConfigMembershipUser : MembershipUser { // custom stuff } I am using Linq-to-SQL to read from a database and get a User entity; to make this function as a…
Scott Baker
  • 10,013
  • 17
  • 56
  • 102
14
votes
2 answers

NonComVisibleBaseClass was detected; How do I fix this?

My class derives from System.Web.Security.MembershipUser I am getting this error when submitting the form. The popup form uses ASPPDFand the application did not have this problem before implementing the custom MembershipProvider goodies. Note this…
5
votes
1 answer

How to check if password answer matches what is provided by a user in ASP.Net

I simply want to know how to manually check if the value a user has provided for the answer to their security question matches their current answer on record. I want to use the build in support of the ASP.Net membership and membershipuser objects. …
4
votes
1 answer

Custom MembershipUser with only needed parameters

I am building a custom MembershipProvider more precisely the GetUser function. Therefor i have a custom MembershipUser. public class CustomMemberShipUser : MembershipUser { public CustomMemberShipUser ( string providerName, …
r3d
  • 85
  • 10
3
votes
2 answers

Implementing Custom Membership user and Custom Membership Provider

References http://msdn.microsoft.com/en-us/library/6tc47t75%28v=VS.80%29.aspx http://msdn.microsoft.com/en-us/library/ms366730.aspx Question In the 2nd link precisely under heading Create a Custom Membership Provider you will note that they mention…
2
votes
1 answer

Override parameterless GetUser in custom membershipprovider

Currently i'm using the following code to get my custom MembershipUser, with my custom membershipprovider: FormsIdentity id = (FormsIdentity)User.Identity; HtCustomUser user = (HtCustomUser) Membership.GetUser(id.Ticket.Name, true); I would like to…
Quad
  • 75
  • 7
2
votes
1 answer

Inheriting From MembershipUser - Asp.net/C#

I have a customer class that inherits from MembershipUser. When i load a Customer object i want to be able to set all the values in the base class easily. I try to declare properties of Customer that hide readonly MembershipUser properties such as…
Frawls
  • 25
  • 3
2
votes
2 answers

Implement Custom MembershipUser and Custom MembershipProvider

I try to implement a Custom MembershipPriver with a Custom MemberShipUser in my own database (with a specifics Users Table Model) : This is ly diffent files : iTwitterMembershipProvider.cs using System; using System.Collections.Generic; using…
Alak
  • 1,329
  • 3
  • 11
  • 18
2
votes
2 answers

MembershipUser class CreateUser password parameter

I'm using the ASP.NET Configuration for my users and their roles. I'm also using the MembershipUser class with its function CreateUser. I have it working, but was curious about something. When I add a new user and pass this function its password…
d3020
  • 537
  • 3
  • 7
  • 16
2
votes
2 answers

Getting Current User Id

I am trying to get the currently logged in user's UserId as mentioned in this post http://msdn.microsoft.com/en-us/library/aa478949.aspx as part of the aspnet_Membership table. Here's where I am looking: MembershipUser user = null; if (User…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94
1
vote
3 answers

C# asp.net custom MembershipUser.createUser() method, call it from createuserwizard control

I have created custom MembershipUser, MembershipProvider and RolePrivoder classes. These all work and I am very happy with it, apart from one thing. I have an extra field in the "Users" table. I have an overridden method for CreateUser() that…
Jon
  • 15,110
  • 28
  • 92
  • 132
1
vote
2 answers

ASP.NET User.Identity.Name alternative?

I've created custom membership provider and it is more convenient for me to operate on MembershipUser.ProviderUserKey rather than UserName. So, to retrieve ProviderUserKey I perform such code: if (User.Identity.IsAuthenticated) { int UserID =…
Wodzu
  • 6,932
  • 10
  • 65
  • 105
1
vote
1 answer

MembershipUser.ChangePassword returns false at all times

Using System.Web.Providers.DefaultMembershipProvider along with System.Web.Security.MembershipUser, I am attempting to change a users password in the databases. For some reason, no matter what I do, the MembershipUser.ChangePassword(old, new)…
WebDevNewbie
  • 1,833
  • 1
  • 13
  • 17
1
vote
1 answer

MembershipUser isApproved not working

I have tried solutions like here How do you update the aspnetdb membership IsApproved value? But it still doesn't work for me. isAprproved always passes true for new member. I am creating a member here: MembershipUser member =…
nickornotto
  • 1,946
  • 4
  • 36
  • 68
0
votes
2 answers

MembershipUser constructor expects dateTime fields that might be null

The MemberShipUser constructor expects dateTime fields like lastLoginDate, which may be null in the data store. However, when I retrieve data from the store and pass null in for the parameter, I get an error that it cannot be null. How can I work…
Caveatrob
  • 12,667
  • 32
  • 107
  • 187
1
2