I have set up Membership and Roles and can create users and login using the ASp Login control. However I need to associate users with customers (in a Customers table in the database) and display content according to the customer that the user belongs to. Is the best way of doing this to create a foreign key field in the aspnet_Users table relating back to Customers table which would have to be updated manually after creating the user or is there a better way?
I am wondering what's the easiest way to go about doing this. I am using the user signup form control that comes with .net and they can create user through the application and once they do users see the "members area" of my site.
However, they are only trial members. using my paypal form, once they pay for service, they become a paid member.. so I want to keep track of this in the membership table by having a column in that table: bit registeredUser. Do I have to create my own overriden membership class for this, at first I thought there was already a column like this called isApproved, but seems thats for something else because if its set to false user cannot even login.
I have a problem with my membership management. I moved the aspnet membership database to my MSSQL server and I would like to create an add user form not using the CreateUserWizard (I would like to add more information then in the simple CUW). I've created the form and I would like to use the Membership.CreateUser method to add the user. After running the script (VB) the user is available in the aspnet_Users table, also in the aspnet_UserInRoles table but not in the aspnet_Membership table. I'm sure that something is wrong with the configuration, I just can't find what.
When creating a foreign key to the membership user table, is it better to refer to the user_id column or is it ok to use the username column? I assume that the Membership spec enforces uniqueness in the username since there is a method Membership.GetUser(username) that returns one user. Using the id is a bit awkward in code because I have to end up casting all over the place like (int)user.ProviderUserKey. The username would give more information quickly when viewing raw data as well. Just wondering if someone knows a reason why I shouldn't use it as the foreign key.
i m working on mvc 3.0 application and using bulting feature of membership for creating account and i have using ASPNET_REGSQL.EXE command than i have migrated table in our database but when i create any user in membership mvc user account but in database, records are not inserted of user ...
There seems to be something wrong with the create user wizard?I am using hashed password storage. When I change it to clear storage I see the user's password is being stored as something completly different than what they typed in.Example: changeme1 now equates to something like: 4W*KQQ4%=SIf I use 4W*KQQ4%=S as the password to login with it works but changeme1 does not.When I use the reset password wizard it updates the password just fine and it works when I login next.Any clues what could be causing this?
I have the default membership table that was added automatically, then just used server explorer to add more columns, like FirstName, LastName, etc. In my code I can access all the default columns, but not the ones I created. Any thing special I need to do?
Here is how I access the table. using user. gives me all columns, but the one I created.
string userName = User.Identity.Name; MembershipUser user = (MembershipUser)System.Web.Security.Membership.GetUser(userName).ProviderUserKey;
There are lots of posts about this issue but I can't work out the answers as most of them are for C# or similar. I'm trying to automatically insert the UserId generated by Membership into a custom table. I have membership working correctly, as well as the custom table (I'm able to insert other things from the registration form). But I can't get it to extract the generated UserId and insert it into the custom table. Here's my code:
As you can see I've experimented with the parameters for inserting the record, but that doesn't work (I get an error about ProviderKey not being a part of system.web.security.membershipuser).
In order to better learn various techniques in ASP.NET development, I've written an ASP.NET app at home, which I use for learning. (It's a simple application we use to track our video library.) When I first started it, I didn't bother with adding membership to it. However, I've recently thought it might be nice to add the ability to allow family members to vote on various movies, etc. In order to track their preferences, I'd need table in the database, etc. (I won't bother going into the details.) So I was thinking that it might be good to add ASP.NET membership to this app, but I've never done that before. Normally, I've only added membership to an ASP.NET app when I was first getting it started; not on an established app. Can I add ASP.NET membership to an older app?
And if the answer to that question is yes, then I would like to use simple Windows authentication. This is a simple peer-to-peer network I've got, everyone has an account (profile) on the box that hosts the ASP.NET app, so I would just use that. Right now this app is an ASP.NET 3.5 app, but I could move it up to ASP.NET 4.0.
I'm currently writing a website in VWD2010 Express, which requires me to write a custom membership provider.
I've followed the tutorial here [URL] , which seems relatively straight forward.
I am, however, struggling at the stage where the custom membership provider is included in a site. Now obviously the tutorial writer is using a different version of VS to me, so I've had to adapt it somewhat. Instead of building the class as a dll, and referencing that in a new site, I've started a new site from scratch and added the custom membership provider to the Add_Code file (HDIMembershipProvider.vb). It is now required that I add details of the provider to the web.config file, which seems to be where I am encountering problems.
The tutorial requires me to add:
within the System.Web part of the web.config file. However, upon running the site I get the error:
Could not load type 'HDI.AspNet.Membership.HDIMembershipProvider'.
I realise that how you reference the class must have changed since the tutorial was written, but I can't for the life of me find the format I should be using, and trial&error has turned up nothing so far.
The error message below i get when I"m trying to create a new user in a project management system we use for a client. I type in all the corresponding information then when I click create it throws this error.
invocation. at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture) at System.Web.Administration.WebAdminMembershipProvider.CallWebAdminMembershipProviderHelperMethodOutParams(String methodName, Object parameters, Type paramTypes) at System.Web.Administration.WebAdminMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status) at System.Web.UI.WebControls.CreateUserWizard.AttemptCreateUser() at System.Web.UI.WebControls.CreateUserWizard.OnNextButtonClick(WizardNavigationEventArgs e) at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.CreateUserWizard.OnBubbleEvent(Object source, EventArgs e) at System.Web.UI.WebControls.Wizard.WizardChildTable.OnBubbleEvent(Object source, EventArgs args) at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) at System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I would like to know simple thing, If i'm adding additional information to UserProfile such as: Country, PhoneNumber etc'.. So, I added a Table In my DB (which also Got all Membership Provider tables...)
UserProfile, and added Stored Procedures for it for Insert / Update... I would like to know, If I need to create in Business Object a Class for Profile Only? (Cause the User is managed Already by the Membership Provider) And Create for it Also in Business Logic -> ProfileManager with Methods that will use the Stored Procedures to Update and Insert Details? Do I need to do it like this? Or there is another way? What's the right way doing it?
The following code is used to add the asp membership tables to an already existing database instead of creating a seperate database for membership and having two databases in the application.
aspnet_regsql.exe -S .SQLEXPRESS -U username -P password -d databsename -A all
It works fine by adding the membership tables to the existing database that is located in the c drive, program files sqlserver folder.
But my database however is not in the c drive but located in my asp website app_data folder, so the above code does not give any error and the tables are not added after I run it. how can I now add the membership tables using the above code when my database is located in the website app_data folder,
I have a table added to a dbml file in my website. The website is already deployed to Live server. Now I have been instructed to a add a new field to the table. The field will be defaulted as getdate().
I don't plan to modify my dbml file for this change since the filed holds a default value. Will it cause any issue(performance related or any other). I am sure that I will not have to use the newly added field in the website. I am new to LINQ.
I am createing user dynamially with the below code; string MyPassword = Membership.GeneratePassword(8,0).ToString(); Membership.CreateUser(TextBox7.Text, MyPassword, TextBox8.Text); but before I start creating, I would like to check if the user name is used before or not.
I have the following code, i add code for required validator, but when you make selection from dropdown to create the table, the page generates an error. Should the logic be somewhere else to add it to the table? i mean, dont they have to be there so when you submit the form, it fires the validation?
Here is the error that comes up, when i make a selection from my dropdown that creates the table.
Error: Sys.WebForms.PageRequestManagerServerErrorException: Control 'rfvtxtCam1' referenced by the ControlToValidate property of 'rfvtxtCam1' cannot be validated.
How this line if (usrInfo! = null) add another variable that will be used to login.
This line (usrInfo! = null) works, but I have a database table "confirm". If I change in the Admin to "true", the user successfully logged on. If the base table "confirm" set to "false", the user will not be logged.
The following code works if (null! = & usrInfo & usrInfo. IsApproved), but instead of ' IsApproved ', I want to use table "confirm".