simplemembership

Configuring MVC for SimpleMembership

依然范特西╮ 提交于 2020-01-26 01:35:33
问题 I have an ASP.NET MVC application with a number of membership-related pages generated from the project templates. When I attempt to access one of those pages, I get the following error: The ASP.NET Simple Membership database could not be initialized. For more information, please see http://go.microsoft.com/fwlink/?LinkId=256588. After some time spent researching, I determined I was missing the connection string. I have an existing connection string named FreeWebFilesEntities and I created a

How to get Roles from using SimpleMembership?

最后都变了- 提交于 2020-01-21 17:29:32
问题 I am developing a MVC4 application with SimpleMembership. I have a table - "userInfo" in which I am storing user's information such as Name, Email, Address, Phone, Role etc. When I register a user, data is stored in this table and webpages_Membership. No data is stored in other Membership tables (OAuthMembership, Roles, UserInRoles). When I login a user, it is validated using : if (ModelState.IsValid && WebSecurity.Login(Model.Name, Model.Password, false)) it returns "True" but after this, I

How to get Roles from using SimpleMembership?

烂漫一生 提交于 2020-01-21 17:27:29
问题 I am developing a MVC4 application with SimpleMembership. I have a table - "userInfo" in which I am storing user's information such as Name, Email, Address, Phone, Role etc. When I register a user, data is stored in this table and webpages_Membership. No data is stored in other Membership tables (OAuthMembership, Roles, UserInRoles). When I login a user, it is validated using : if (ModelState.IsValid && WebSecurity.Login(Model.Name, Model.Password, false)) it returns "True" but after this, I

MVC 4 SimpleMembership HasLocalAccount method not found

非 Y 不嫁゛ 提交于 2020-01-14 08:09:13
问题 When attempting to access /account/manage on the production server I get this error: System.MissingMethodException: Method not found: 'Boolean WebMatrix.WebData.ExtendedMembershipProvider.HasLocalAccount(Int32)'. at Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.HasLocalAccount(Int32 userId) at PROJECT.Controllers.AccountController.Manage(Nullable`1 message) at lambda_method(Closure , ControllerBase , Object[] ) at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object

Role Provider in SimplerMembership

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-07 06:19:33
问题 I used the standard VS 2012 MVC 4 Internet template in a .NET Framework 4 project. I was mainly using External Logins (Google, Microsoft, Facebook, Yahoo, Twitter) to access the parts of my application which are decorated with the [Authorize] attribute. [One thing I noticed is that the default web.config created by VS does not contain any sections on membership or role providers, unlike those I see in an ASP.NET web form application.] I deployed the project to an azurewebsites.net site.

how can i use AntiForgeryToken with JSON post in mvc 4

痴心易碎 提交于 2020-01-06 15:41:31
问题 I have jQuery code that post data with JSON.stringify to controller class but when I used AntiForgeryToken, it doesn't work.. is any better way to secure JSON post or I am missing out something.... secondly do i need additional to this .. i.e. encryption to secure JSON data... many thanks for help in advanced... <script type="text/javascript"> $(document).ready(function () { $('#id_login_submit').click(function () { var _authetication_Data = { _UserName: $('#u1').val(), _Password: $('#p1')

System.NotSupportedException: Specified method is not supported

放肆的年华 提交于 2020-01-03 13:11:08
问题 Is it possible to get the password of a user? How, please? When I've tried this code : WebSecurity.InitializeDatabaseConnection("nectarys-pc.MonitoringN.dbo", "Superviseur", "UserId", "matricule", autoCreateTables: true); var membership = (SimpleMembershipProvider)Membership.Provider; model.motDePasse = membership.GetUser(superviseur.matricule, false).GetPassword(); This exception appears in the last line : System.NotSupportedException: Specified method is not supported. How to deal this?

System.NotSupportedException: Specified method is not supported

和自甴很熟 提交于 2020-01-03 13:11:04
问题 Is it possible to get the password of a user? How, please? When I've tried this code : WebSecurity.InitializeDatabaseConnection("nectarys-pc.MonitoringN.dbo", "Superviseur", "UserId", "matricule", autoCreateTables: true); var membership = (SimpleMembershipProvider)Membership.Provider; model.motDePasse = membership.GetUser(superviseur.matricule, false).GetPassword(); This exception appears in the last line : System.NotSupportedException: Specified method is not supported. How to deal this?

SimpleMembership - anyone made it n-tier friendly?

僤鯓⒐⒋嵵緔 提交于 2019-12-29 14:30:14
问题 "SimpleMembership", we're told, is the future of asp.net membership / role management. The MVC4 "Internet Application" template implements Account management using SimpleMembership. However, the way it is implemented merges all the application tiers into 1. It kind of shocked me that after all the work they've put into layering apps properly with MVC, we get this shoddy implementation of "the way forward" for Membership with no DI, use of WebMatrix DLLs and complete lack of SoC. Particularly

Using MVC 4 SimpleMembership with an existing database-first EF model

这一生的挚爱 提交于 2019-12-28 10:07:25
问题 I am trying to use SimpleMembership in my MVC 4 for the first time and I already have an existing database and EF5 model created based on it! I searched a lot but I cant find how I could use it in my case and also to have everything under my own model. It would be great if somebody can give me an idea how to do this. Thanks 回答1: Purely as a point of reference, it might be a good idea to create a new Internet Application template of an ASP.NET MVC 4 Web Application project (i.e. via File > New