asp.net-membership

ASP.NET Membership Provider with Confirmation email

时间秒杀一切 提交于 2020-01-01 07:40:47
问题 Is there any framework/library for using ASP.NET Membership Provider with confirmation email, something ready to be used ? Standard functionality used on almost all public web sites. 回答1: Found good example: 4Guys from Rolla : Examining ASP.NET 2.0's Membership, Roles, and Profile 来源: https://stackoverflow.com/questions/424154/asp-net-membership-provider-with-confirmation-email

c# User.IsInRole Namespace

故事扮演 提交于 2020-01-01 06:53:59
问题 Note, I am using c# MVC 3, I am trying to use this within a class, NOT a controller. I have the following at top of my program using System.Web.Security; I tried to do the following but get the message: The name 'User' does not exist in the current context. Here is my partial code: using System.Web.Security; .... .... if (User.IsInRole("Admin")) { } I am thinking that is has to do something with the namespace but looking at the documentation, all I should need is System.Web.Security. 回答1: Try

Using ASP.NET SQL Membership Provider, how do I store my own per-user data?

青春壹個敷衍的年華 提交于 2020-01-01 05:42:08
问题 I'm using the ASP.NET SQL Membership Provider. So, there's an aspnet_Users table that has details of each of my users. (Actually, the aspnet_Membership table seems to contain most of the actual data). I now want to store some per-user information in my database, so I thought I'd just create a new table with a UserId (GUID) column and an FK relationship to aspnet_Users . However, I then discovered that I can't easily get access to the UserId since it's not exposed via the membership API. (I

Use ASP.NET Membership in ServiceStack

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-01 05:37:05
问题 how can i use asp.net membership in ServiceStack ? (ServiceStack.OrmLite , ServiceStack.Host.AspNet , etc ) 回答1: You can host ServiceStack on a custom path, i.e. at /api which lets you run ASP.NET web forms and ServiceStack side-by-side and then use the normal ASP.NET membership provider in ASP.NET. You can then share UserSessions with ServiceStack using its Session Provider, here's an example on how to instantiate a Session with MVC - you can use this same class with ASP.NET. The alternative

Authentication engine for ASP.Net MVC like Devise for Rails?

情到浓时终转凉″ 提交于 2020-01-01 04:48:07
问题 Devise Authentication gem ( http://github.com/plataformatec/devise ) is a Rails tool to authenticate a user and set up his identity in a Rails app. I have found so many cool things like this for Rails that I am just blown away at that whole platform. I've only been learning Rails since April, and I just love it. However, I still also work in ASP.Net MVC, and I have created my own little login controller for my MVC app. It seems like everyone does this for their MVC app, right? It was not

ASP.Net Membership.DeleteUser

感情迁移 提交于 2019-12-31 22:25:19
问题 In testing, the user on a db i've used was a big jefe. In production, he only has Execute. When I called, Membership.DeleteUser(user) In testing, it worked. I try the same in production, and I get this: The DELETE statement conflicted with the REFERENCE constraint "FK__aspnet_Us__UserI__37703C52". The conflict occurred in database "Testing", table "dbo.aspnet_UsersInRoles", column 'UserId'. In my seargles (searches on Google), I came across this link where the dude was saying, Error: The

ASP.NET Membership: CSS being blocked by Deny users, page doesn't render correctly?

只谈情不闲聊 提交于 2019-12-30 08:25:55
问题 I have a page that functions correctly but when i issue a deny user for the whole site it redirects me to the logon page which seems to work BUT the css is not working. Hence there is no styling.. Can anyone help? My web.config is like so <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="2880" /> </authentication> <authorization> <deny users="?" /> <allow users="*" /> </authorization> This logon page uses a site.master has the following style sheet but fails to style

Implementing Custom Membership user and Custom Membership Provider

梦想的初衷 提交于 2019-12-30 07:10:57
问题 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 this You will need to create a custom membership provider that supports both your custom membership user type, and your custom membership data store. The GetUser and CreateUser methods of the custom membership provider can be written to return

What does FormsAuthentication.SetAuthCookie do

 ̄綄美尐妖づ 提交于 2019-12-30 01:59:12
问题 I'm using A createuserwizard control. On the CreatedUser Event I placed this code to add the user to a role. protected void RegisterUser_CreatedUser(object sender, EventArgs e) { FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */); if (!Roles.IsUserInRole("Test")) { var User= Membership.GetUser(); Roles.AddUserToRole(User.UserName, "Test"); } string continueUrl = RegisterUser.ContinueDestinationPageUrl; if (String.IsNullOrEmpty(continueUrl)) {

Alternatives to .Net Membership

帅比萌擦擦* 提交于 2019-12-30 00:52:14
问题 Are there any alternatives\mods to .net Membership? I find it quite restrictive; Cant change Username, easily. You have to create a new user and copy the fields, but then you lose the primary key OR you have to edit the user table directly yourself. Additional profile fields are stored together as one blob. 回答1: ASP.Net membership uses a provider model. That means you are completely free to implement your own membership provider, or even inherit from and extend an existing provider, as long