asp.net-mvc-5

Understanding MVC-5 Identity

ⅰ亾dé卋堺 提交于 2019-12-03 07:54:21
问题 I created a new ASP.NET MVC-5 application with Individual User Accounts and then updated all the Nuget packages in the solution. Now I'm trying to follow some of the guidelines shown in some tutorials but I encountered some problems. The first one is that a class called ApplicationRoleManager which is being used throughout the application wasn't created (the ApplicationUserManager was created). The second problem is more about Entity-Framework : I've seen that for seeding the database with a

ASP.NET MVC5 - Keeping Users in Oracle Database

让人想犯罪 __ 提交于 2019-12-03 07:40:09
问题 Once creating a ASP.NET MVC5 project (with target framework is .NET 4.5.1 and the authentication type is Individual User Account ), so what is the most elegant way to configure the project so that it keeps the user, claims, roles etc. in an Oracle 12c database? I mean, how can I keep the authorization/authentication data in Oracle without deforming the automatically-generated MVC5 project structure. I guess changing the <defaultConnection> tag is not enough and there should be another Oracle

ASP.Net MVC Angular 2 Final

女生的网名这么多〃 提交于 2019-12-03 07:28:20
问题 Has anyone tried Angular 2 RC Final with ASP.Net MVC? I am having trouble with configuring Angular 2 RC 6 with ASP.Net MVC, till beta 17 everything was working fine. The package.json with below configuration doesn't seems to be working: "dependencies": { "@angular/common": "2.0.0-rc.6", "@angular/compiler": "2.0.0-rc.6", "@angular/core": "2.0.0-rc.6", "@angular/forms": "0.3.0", "@angular/http": "2.0.0-rc.6", "@angular/platform-browser": "2.0.0-rc.6", "@angular/platform-browser-dynamic": "2.0

Cannot login on ASP.NET Identity 2 site after programmatic user creation

自古美人都是妖i 提交于 2019-12-03 07:24:49
问题 I have a new MVC 5 razor, EF 6 web application using ASP.NET Identity 2 for the membership system. When I create the users manually using the Register link on the web page, it goes fine. I can create the user, I can then login with the given password and then logout. I don't know how to use the database initializer with migration for Identity 2, there are countless examples with Identity 1 and other alpha and beta versions which only serve to confuse people. Since I don't know that yet, I use

Razor 2 to Razor 3 MVC 5

萝らか妹 提交于 2019-12-03 07:24:20
问题 I've been working on an MVC 4 solution, and I've been trying to upgrade it to MVC 5. I've followed the steps outlined here. I've followed it, and now whenever I run the MVC Application, it gives me this error message: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at

Facebook MVC 5 ASP.NET Identity - Email is null for certain users

六月ゝ 毕业季﹏ 提交于 2019-12-03 07:20:47
This is a problem i am trying to solve for a month now. (tried any possible article/code out there). In ExternalLoginCallback action, AuthenticationManager.GetExternalLoginInfoAsync() returns a valid object (with all the provider details) but email is null for certain Facebook users . For the large majority of Facebook login email is presetnt. But for about 30% of logins I get an exception down the process because the email is null. Luckily sometime ago I've created a Facebook user which reproduce the problem . I've created a sterile test environment in localhost and indeed email comes null

How to configure StructureMap for asp.net MVC 5

二次信任 提交于 2019-12-03 07:06:32
问题 I'm getting below error. I setup it similar to asp.net mvc 4. No parameterless constructor defined for this object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.MissingMethodException: No parameterless constructor defined for this object. Finally found the actual exception "Activation error occured while trying to

How to refresh ASP .NET MVC page when hitting browser back button

*爱你&永不变心* 提交于 2019-12-03 07:05:30
I just found that when I click browser back button on any ASP .NET MVC page nothing happens and page is not going be updated. And only if you click F5 it will be updated only. The main problem that I do some changes of DOM of the page i.e. add table rows select radio-buttons and etc and when I go back to page by hitting browser back button I have see no changes. How it can be resolved for ASP .NET MVC 5? Thank for any clue... P.S. I have read http://forums.asp.net/t/1304752.aspx?how+to+refresh+page+when+hitting+back+button but it does not help... Here is a proper solution http://dotscrapbook

Web API 2 OWIN Bearer token authentication - AccessTokenFormat null?

蹲街弑〆低调 提交于 2019-12-03 07:01:10
问题 I have an existing ASP.NET MVC 5 project and I'm adding a Web API 2 project to it. I want to use bearer token authentication and have followed Hongye Sun's tutorial "OWIN Bearer Token Authentication with Web API Sample" and this question as well. In my Login method, for the line Startup.OAuthBearerOptions.AccessTokenFormat.Protect(ticket); , the AccessTokenFormat is null. Any idea why? My AccountController : [RoutePrefix("api")] public class AccountController : ApiController { public

ASP.NET Identity

旧时模样 提交于 2019-12-03 06:57:44
问题 I'm currently building a new ASP.NET MVC 5 project which I want to release around September. I need to choose a membership system, but I'm currently quite confused about which direction should I take. The current SimpleMembership works well, but will apparently be incompatible with the upcoming ASP.NET Identity. ASP.NET Identity on the other hand is absolutely new with zero documentation and can change anytime. Finally it seems that string based IDs are used here, which seems like a very