asp.net-mvc-5

What's the best way to perform CRUD with ASP.NET Identity?

柔情痞子 提交于 2019-12-11 02:28:55
问题 By default, ASP.NET MVC's implementation of Identity for authentication does not support full CRUD operations for it's users. I know it already has : Register, Login, Manage, and Change Password But the problem is that doesn't have : Account Update or Edit, Select User Role, and Delete User I think that Identity is still incomplete in a way that there is no concise documentation which causes me to have a very ugly looking learning curve. Or if there's a better way and place to learn it, can

Adding Extra Data to Auth Cookie after login - MVC 5

≯℡__Kan透↙ 提交于 2019-12-11 02:21:07
问题 We have an extra mandatory step after a user signs into our MVC5 site. This is because some users have access to multiple offices. I got some help with how to enforce with this SO question, Adding extra step to ASP.NET MVC authentication Once the user has performed that step I need to stash their office selection in the authentication cookie. How do I store extra data into the authentication cookie, after Login has been completed? Is the correct method of accessing that extra data a custom

Jssor Slider horizontal scroll issue

瘦欲@ 提交于 2019-12-11 02:09:38
问题 I'm using nopcommerce 3.80 for my site and wanted to use vertical full width slides on home page. I used Jssor slider jquery in place of nivo by editing my Nivo slider plugin. I'm able to see a vertical slider at homepage now, but it is giving a horizontal scroll bar and the image is not extending to full width instead it is giving white blank space in the right side. And also the scrollbar is making the page in the right side with white space and below the slider also. Please see the

How to update view model in a partial view in MVC5?

折月煮酒 提交于 2019-12-11 02:05:04
问题 I have a View and inside that view I have a div that will contain a partial view. My issue is this. The user selects an item from the dropdownlist and I load the partial view with the model. The user change changes some of the textboxes and clicks the button to submit the partial view (which is in a Html.BeginForm). When I go to examine the model in the controller the model doesn't contain the changes that the user made. Why doesn't the model reflect the changes the user made? In the main

Ajax post a form (validation) in MVC AsP.net?

只谈情不闲聊 提交于 2019-12-11 01:58:28
问题 So I have a page that have a few forms on it and one of those forms is a one for addresses which has three functions. Save as new, Update and Delete. I want to use form.submit() to fire the MVC validation on the client and server side but I dont want the entire page refresh. So this is what I want to use the simple form.submit() to gather the elements and send it to the ASP.net MVC controller as a model and handle the validation based on the attributes I have on the model and use a callback

Return to second to last URL in MVC (return View with previous filter conditions applied)?

隐身守侯 提交于 2019-12-11 01:53:17
问题 I'm working on an MVC5 application. On the home screen is a grid allowing users to view Data and be transferred to a number of Views for various actions on each record. One of these is an [EDIT]. The issue I'm encountering is as follows: due to the amount of data it is convenient to Filter the data down (say to a specific location) and then Edit records from there. The filter on this grid (Grid.MVC from CodePlex) performs filtering partially by modifying the URL (http://homeURL/?grid-filter

_Layout.cshtml cannot be requested directly because it calls the “RenderBody” method

隐身守侯 提交于 2019-12-11 01:48:36
问题 I using attribute to routing. Is that relevant, I don't know. When I don't use "Route" attribute, _Layaout() action in shared controller doesn't work but page is rendering. public class SharedController : Controller { // GET: Shared [AllowAnonymous] public ActionResult _Layout() { return View(); } } When I use "Route" attribute it does work but I getting following error: public class SharedController : Controller { // GET: Shared [AllowAnonymous] [Route] public ActionResult _Layout() { return

Rendering a partial View with Ajax Unobtrusive

别等时光非礼了梦想. 提交于 2019-12-11 00:34:28
问题 I have the following View and Partial View. In the index action method I need the Create to rendered as a Partial View. Based on the answer in this question I tried using Ajax helper methods(I find AJAX and JS so hard for me to comprehend). @model IEnumerable<TEDALS_Ver01.Models.UserRight> @{ ViewBag.Title = "Index"; } <table class="table"> <tr> <th> @Html.DisplayNameFor(model => model.UserName) </th> <th> @Html.DisplayNameFor(model => model.UserCode) </th> <th> @Html.DisplayNameFor(model =>

Get client IP in Azure through MVC 5 controller

为君一笑 提交于 2019-12-11 00:13:42
问题 I can't find a question or post specific to Azure for this, and I'm not sure what's different in the environment in Azure versus my testing environments that would cause this. I've tried a few methods to get this to work but I'm not coming right. Please note this isn't Webapi, so using the HttpRequestMessage, as far as I know, is not going to work either. Here's what I've tried so far: Method 1: string ipAddress = ""; IPHostEntry Host = default(IPHostEntry); Host = Dns.GetHostEntry(System

Is it possible to upgrade an existing MVC4 Web application to MVC5?

回眸只為那壹抹淺笑 提交于 2019-12-10 23:27:00
问题 The reason why I want to upgrade from MVC4 to MVC5 is because MVC5 has Entity Framework Identity already there. I don't want to spend time trying to add Identity to my MVC4 project because it'll take too much time. Is there like an update button which does it automatically or do I need to create a MVC5 template and copy codes over? 回答1: I upgraded form MVC4 to MVC5 by following the steps at this link How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2 that walk