C# - Create A Customized Membership?
Feb 26, 2011Need to create a customized membership with database and web application in asp.net mvc.
View 1 RepliesNeed to create a customized membership with database and web application in asp.net mvc.
View 1 RepliesI just like to know how can i create my own authentication(calling the ASP .net membership, role) page with the same function as the LOGIN Control. Your wondering, why not use the Login control instead. I have my own design and i don't know how to pattern my design to the built in Login Control. I tried editing the login template, but it's pretty hard to pattern it to my design.
This is my design
Basically what would like to know how the Login Control calls for the authentication, and when authenticated, it will pass the user(full name) to my LoginView Control without any coding. Or is it possible that I remove default login button in the LOGIN Control then create my own button and trigger the authentication or validation? But if you have other suggestion that can follow my design and call the authentication, i would be happy to know.
I've created a very simple website with two roles, "administrator" and "employees". I've also added users using asp.net configuration wizard for both. My concern, however, is that going ahead it will not possible to use the wizard to add new roles, assign them or alter them once the site is online. I won't be the administrator and so I need to find a way for the administrator to add new roles and assign them to users from a remote connection. Where can I find some information on creating such forms?
View 3 Replies[Code]....
My question is: how can i create my own parameter based upon the QueryStringParameter?
Example:
[Code]....
I now called it QueryStringGuidParameter.
The purpose of this is: I'm not sending any querystring's via the aspx?querystring other thasn aspx?guid={guid identifier}.I hope my code below explains it al little bit.
[Code]....
A soon as a page Redirects f.i. with this example
[Code]....
Instead of calling Response.Redirect i call the Redirect i created. This transforms the querystring in a session with a guid and parameter. The Redirect only sends the guid in the querystring. and the receiving page picks up the guid and translates it back into a querystring.
Purpose is you have a secure way of dealing with info sending via querystrings. Lets say in the past you could easily get other info from the page by just changing a value in the key send via a querystring. In my case lets say the user request a Customer "A" with querystring ?ID=1.
Simple change the query in the addressbar to ?ID=2 (or something else) would give him another customer. Maybe a customer he is not allowed to see. (Of course this can be prevented also in the business layer, but that's not the point.)
So if i simply could create a new QueryStringParameter lets say called QueryStringGuidParameter which i can use in the ObjectDataSource but ideally just for all controllers which are able to use the QueryStringParameter , i don't have to go into code behind and set the SelectParameters in there.
i have defined a dropdown list in the controller
[Code]....
then i can show this dropdownlist in my "about" view <%=Html.DropDownList("a") %>.
BUT, now i want to define this dropdown list at my back end. what i want to do is to create a new "Helper".cs file in my project, and create a function within it. so every time if i want to show this dropdown list, i can just simply call this function instead of Add new SelectListItems one by one. is there anyone tell me how to do it?? and is it a good way to create a dropdownlist at the back end?
probabaly a daft question but when creating a user using .net membership, can i exclude the username and just have the email as the 'username' like this?
Membership.CreateUser(model.UserName, model.Password, model.Email, ....
or leave blank...
Membership.CreateUser("", model.Password, model.Email, ......
i am developing a website in vb.net ,as i am having 3 urser,customer,admin,and employee
i have taken the loginpage and in the codebehind i have permission access to the customer,admin and employee,with different user names and password now my problem is how to make the page to recover the password if the user forget the username or password
How do I create a custom membership for ASP.NET MVC 2 based on the ASP.NET membership provider?
View 5 RepliesI have an administration website - the users of which should be able to modify users for a public site. This means the administration site has a valid membership provider, but I want to be able to access/change members in another site (and therefore ApplicationName).
First thought was to set ApplicationName on the Membership static - but that seems like a bad idea according to answers here: Changing Membership.ApplicationName in code - thread safety.
Second thought was to duplicate the MembershipProvider entry to the web.config - so now I can do WebSiteMembershipProvider = Membership.Providers("WebsiteSqlMembershipProvider") - but I can't now seem to get to a 'Membership' object which will let me (for example) call the standard 'CreateUser' method.
I tried WebSiteMembershipProvider.CreateUser - but it takes a load more parameters, and doesn't seem to do anything if I poke some values into it.
Am I nearly there? Or do I need a different approach? There's always the SqlProvider's stored procedures, I suppose...
Just trying to create a new web project in VS2010 with the default membership dB, but when I run the WSAT tool, I get the error:
There is a problem with your selected data store. This can be caused by an invalid server name or credentials, or by insufficient permission. It can also be caused by the role manager feature not being enabled. Click the button below to be redirected to a page where you can choose a new data store.
The following message may help in diagnosing the problem: Could not load type 'NewSite.Global_asax'.
I thought VS2010 would automagically create the aspnetdb.mdf dB in the App_data folder.
I would like to know how to create new TextBox in membership?
Exist:
User Name:
Password:
[code]...
I had to upgrade a sites ecuroty from a custom system to .net membership. I created all the users like this.
ds = Wservices.SelectBulkUsers()
If Not ds Is Nothing AndAlso Not ds.Tables(0) Is Nothing AndAlso ds.Tables(0).Rows.Count > 0 Then
For Each dr In ds.Tables(0).Rows
username = dr("username")
password = dr("password")
role = dr("SecurityClearance")
email = dr("email")
Dim newUser As MembershipUser = Membership.CreateUser(username, password, email, "", "", True, status)
Select Case role
Case "1"
Roles.AddUserToRole(username, "normal user")
Case "2"
Roles.AddUserToRole(username, "administrator")
Case "3"
Roles.AddUserToRole(username, "super administrator")
End Select
If newUser Is Nothing Then
errorMsg = username & " - " & status.ToString & "<br />"
End If
Next
litResult.Text = errorMsg
End If
I thought everything was fine and then went through the labourious task of replacing all the usersids used a as a foreign key in all the tables. It was only after doing this and trying to log on I couldnt, and noticed the membership table was empty. I assumed (stupidly) as it had done the users/ roles it must have done the membership. As I have already re-assigned the old user ids I dont want to import again as the userid will chnage. So my question is: Can I create a membership for each of the users in my aspnet_users table? I have the passwords etc in varchar fields at min from old table.
how can I add default users in my web.config to test my asp: login control
View 1 Replieshow i can add more colums in Singup Page with aspnet membership?
like yahoo,gmail and most of site use(gender,address,phone and more...)
My question relates to membership providers. I have two websites that run on two different servers. One website is a community website that uses Telligent community server 2007. The other is a website that contains information. I have a form where users can request more information. What I would like to do is when a user requests more information, automatically create a user account in my community website. I was told that I can create a custom asp.net membership provider that will create a new user account in my community website. I have read some info at msdn and asp.net websites, but I am still unclear as to how I can create a custom membership provider that will work across different websites running on different servers.
View 1 RepliesIs it possible to have an ASP.NET website which allows users to register and login, without using a MembershipProvider?
And instead just work directly towards custom database tables which stores user information?
I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs?
View 3 Repliesi am using membership provider to create new user.
View 2 RepliesI'm using the membership class in my application, but when I assign a Role to a User it create again the same user with other ID.
This is my Web.Config:
<?xml version="1.0"?>
I am using the createuserwizard but have also created my own database where the data will be stored NOT using the standard aspnetdb.
But i am getting checkschemaversion errors when registering the user. The thing is that the data actually gets stored in my own db even though error occurs.
I am using Membership createuser but how can i override this to use with my own db rather the aspnetdb where it requires all standard tables and stored procedures to be created
I have a application that connects to a remote sql server. I am able to create users and they are stored in the DB. Then I can go to the login page and login. But after a while, I am unable to log in and it just sits at the login page. The user is still in the DB
<configuration>
<connectionStrings>
<add name="LoginSQL" providerName="System.Data.SqlClient"
[code]...
any tutorials or materials that to implement a custom membership provider where I can using Linq to Entities for data retrieval in its internals?
View 1 RepliesI have more of the same applications.All tables are identical.Each application has a new user.These different applications are located in different domains such as.: domena1.com, domena2.com, domena3.com.Each domain has different users.
For each domain in the web.config change the "ApplicationName", eg.:
ApplicationName = domain1, ApplicationName = DOMAIN2, ApplicationName = domain3 ...
It's new to me to use the membership provider class.I was able to inherits the MembershipProvider in my library(HDIMembershipProvider.vb) and a lot of functions are generated. When I created the form to create a user like this:
[Code]....
Once the user clicks submit, how this function can be called ?
[Code]....
Each time I submit, the function is never called.
[Code]....
I have a CreateUserWizard that uses the membership provider and creates a user in a sql server database.I need to change the IsApproved property on creation to false.I know that it can be done by createing a custom navigation template... but then i will have to code all the checks for the creation of the user...Is there any other way to access that attribute?this is the aspx code:
[Code]....