asp.net-mvc-5

Visual Studio 2015 - Shared Projects Reference Tab Missing on Web Project

对着背影说爱祢 提交于 2019-12-02 21:19:23
I upgraded to Visual Studio 2015 from our MSDN subscription because I was pretty excited to read about Shared Projects... No more managing 21382 nuget packages in our dependencies when all we want to do is reuse code. So I built a test shared project with some code in it. Then I add a new empty web application on .Net 4.6 to the project. Now I expected to go to references and see a "Shared Projects" tab on the references window, but I do not see one. Now I can add a class library to the same solution and I see the tab and can add the shared reference. However I cannot add the shared project to

ASP.NET MVC5 - Keeping Users in Oracle Database

被刻印的时光 ゝ 提交于 2019-12-02 21:05:56
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 implementation to replace Microsoft.AspNet.Identity.EntityFramework . It would be very helpful to

ASP.NET Identity

烂漫一生 提交于 2019-12-02 20:36:58
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 unnecessary overhead compared to integer based IDs, which SimpleMembership supports. Is there a good,

How can I return a JSON result to a Ajax.BeginForm

孤街醉人 提交于 2019-12-02 20:17:13
I have got this simple form: @using (Ajax.BeginForm("CreateProductFromAjaxForm","Product" , null, new AjaxOptions() { HttpMethod = "post", OnSuccess = "getresult" }, null)) { @Html.EditorFor(m => m) <hr /> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <input type="submit" class="btn btn-info" value="Next" /> </div> </div> } And, for testing, a simple controller: [HttpPost] public JsonResult CreateProductFromAjaxForm(CreateProductModel model) { if (!ModelState.IsValid) { return new JsonResult() { JsonRequestBehavior = JsonRequestBehavior.AllowGet, Data = new { result = "error

nUnit testing a controller extension method

萝らか妹 提交于 2019-12-02 20:08:47
问题 UX controls framework I'm using requires an extension method on MVC controllers. A null object reference is thrown when nUnit tries to call that method (used in order to package a partial view into Json). The author of the framework suggested calling that method through an interface, however that just postpones the null error. Is there a way to test the ActionResult from a controller that uses an extension method? The Controller Create() method returns the resulting partial from the extension

Razor 2 to Razor 3 MVC 5

别等时光非礼了梦想. 提交于 2019-12-02 19:56:09
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 location 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0_

Integrate Angular 5 with ASP.NET MVC 5

我们两清 提交于 2019-12-02 19:41:02
I am trying to integrate an Angular 5 app generated with CLI project into an existing ASP.NET MVC 5 application. I created the angular project with CLI inside the ASP.NET MVC project, and I want to use Angular 5 components inside razor views; those will be simple razor views and inside those, I will display some Angular 5 components. I've done this with ASP.NET Core 2, I changed the Outdir property to wwwroot in the file .angular-cli.json , and it worked, but I could not do it with ASP.NET MVC 5. Can anyone help? Thank you PS: many tutorials use old versions of Angular and they used a file

MVC 5 OWIN login with claims and AntiforgeryToken. Do I miss a ClaimsIdentity provider?

寵の児 提交于 2019-12-02 19:27:00
I'm trying to learn Claims for MVC 5 OWIN login. I try'ed to keep it as simple as possible. I started with the MVC template and inserted my claims code (see below). I get an error when I use the @Html.AntiForgeryToken() helper in the View. Error: A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovid er' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is

How do I create a ClaimsIdentity object for Asp.NET MVC 5?

怎甘沉沦 提交于 2019-12-02 19:09:39
I am working in a .NET MVC 5 application. I do not want to use Entity Framework. I want to authenticate to a RavenDB database. It looks to me that I want to replace the UserManager that comes with the Account Controller. I think I can rewrite all the UserManager functions to work with my database, except I don't understand the ClaimsIdentity object. In the SignInAsync method, there is a call to UserManager.CreateIdentityAsync(...) . I know it returns a ClaimsIdentity object. What I don't know is how to create a ClaimsIdentity object on my own. I see that it has 4 properties Actor ,

Upgrading a project to MVC 5

大憨熊 提交于 2019-12-02 18:46:53
I have been looking for a solution to upgrade a current MVC 4 app that i have to use the new MVC 5 binaries. I cannot find a solution anywhere. Anyone have any ideas? Visual Studio 2013 will automatically upgrade a project simply by allowing the Nuget Package Manager to run Updates. Steps: In Visual Studio 2013, open the project and right click on the project name to open the Properties window. Change the Target Framework to at least 4.5. Then, on the project right click on the References item, and select Manage NuGet Packages. On the right side of the window select "Updates", and underneath