membership

Is it possible to change the username with the Membership API

徘徊边缘 提交于 2019-11-27 14:34:53
I am using the default sql membership provider with ASP.NET and I would like to provide a page to change the user's username. I believe I am sure I could do this with a custom provider, but can this be done with the default provider? Second part of my question is: Should I allow users to change their username after the account is created? It's true that the default SQL Membership Provider does not allow username changes. However, there's no intrinsic reason to prevent users from changing their usernames if you have a valid argument, on your site, to allow it. None of the tables in the SQL

How do I setup a Membership Provider in my existing database using ASP.NET MVC?

試著忘記壹切 提交于 2019-11-27 12:04:12
问题 For some reason, the idea of setting up Membership in ASP.NET MVC seems really confusing. Can anyone provide some clear steps to setup the requisite tables, controllers, classes, etc needed to have a working Membership provider? I know that the Demo that MVC ships with has an Accounts controller. However, should I be using this in my own project? What do I need to get my existing database ready if so? If not, how do I learn what I need to do to implement a membership provider? 回答1: Check out

Using ASP .NET Membership and Profile with MVC, how can I create a user and set it to HttpContext.Current.User?

a 夏天 提交于 2019-11-27 09:47:56
问题 I implemented a custom Profile object in code as described by Joel here: How to assign Profile values? I can't get it to work when I'm creating a new user, however. When I do this: Membership.CreateUser(userName, password); Roles.AddUserToRole(userName, "MyRole"); the user is created and added to a role in the database, but HttpContext.Current.User is still empty, and Membership.GetUser() returns null, so this (from Joel's code) doesn't work: static public AccountProfile CurrentUser { get {

Mysterious for loop in python

烈酒焚心 提交于 2019-11-27 07:56:41
问题 Let exp = [1,2,3,4,5] If I then execute x in exp , it will give me False . But if I execute : for x in exp: if x==3: print('True') Then execute x in exp , it returns True . What's happening here? I didn't assign anything to x. Did I? I am really confused. **EDIT:**Sorry if I didn't say this before: x is not defined before. Answer Thank you everyone. I understand it now. the elements of exp is assigned to x as exp is iterated over. And x in exp equals True in the last line of code because the

“The system cannot find the file specified”

こ雲淡風輕ζ 提交于 2019-11-27 05:14:37
I saw many questions on SO with this error. But none were related to forms. I just hosted my application server after testing locally. I think it worked for a few mins but I'm not sure as I may have looked at the localhost tab for a moment. Then it stopped working. I may have changed something as I was making changes on server too. I checked my connection string and also tried logging into the DB using other ways and it is online. So, any clues what could be wrong. I don't think it is possible that sql server is only not responding to requests from an app and is available if you log in through

How to combine using Membership API with own application related data?

自作多情 提交于 2019-11-27 01:54:10
Designing a new application in asp.net 4 I have to make a decision how to use a MS SQL Membership API along with my own data in the MS SQL data base. Firstly I need to store and access user profile data in more flexible manner then the Profile provider supports. Secondly I would like to link other user related information (e.g. Orders). No matter where you store your aspnetdb tables (in the separate data base or in the same data base with your data), the problem stays how to keep your data synchronized. After a research I see the following relevant options: 1. Foreign key UserId from asp_Users

How to create user profiles with PHP and MySQL

♀尐吖头ヾ 提交于 2019-11-27 01:41:26
问题 I need some help on creating a user profile system. I want it to be like Facebook or Myspace where it has only the username after the address, no question marks or anything, for example, www.mysite.com/username . I have all the register, logging scripts, etc. all done, but how do I go to profiles using the URL example above, "/username"? 回答1: You would need to create a mod rewrite that took the first directory and passed it as a $_GET parameter. Try this: RewriteEngine On RewriteBase /

How can I access UserId in ASP.NET Membership without using Membership.GetUser()?

橙三吉。 提交于 2019-11-27 01:21:33
问题 How can I access UserId in ASP.NET Membership without using Membership.GetUser(username) in ASP.NET Web Application Project? Can UserId be included in Profile namespace next to UserName ( System.Web.Profile.ProfileBase )? 回答1: Try this: MembershipUser CurrentUser = Membership.GetUser(User.Identity.Name); Response.Write("CurrentUser ID :: " + CurrentUser.ProviderUserKey); 回答2: Is your reason for this to save a database call everytime you need the UserId? If so, when I'm using the ASP.NET

How do you pass an authenticated session between app domains

元气小坏坏 提交于 2019-11-27 01:11:31
问题 Lets say that you have websites www.xyz.com and www.abc.com. Lets say that a user goes to www.abc.com and they get authenticated through the normal ASP .NET membership provider. Then, from that site, they get sent to (redirection, linked, whatever works) site www.xyz.com, and the intent of site www.abc.com was to pass that user to the other site as the status of isAuthenticated, so that the site www.xyz.com does not ask for the credentials of said user again. What would be needed for this to

Using one Asp.net Membership database with multiple applications Single Sign On

我只是一个虾纸丫 提交于 2019-11-27 00:58:35
I have two asp.net applications on one IIS server and I would like to use the same back end asp_security database and membership provider. I've read that all I have to do is reference the same application name in both web configs as I'm doing now, but I must be doing something wrong In each applications web.config I have this section. <membership> <providers> <clear/> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="membership" enablePasswordRetrieval=