asp.net-mvc-5

How to manage required features are not enabled exception in AspnetBoilerplate?

落爺英雄遲暮 提交于 2020-01-16 11:59:09
问题 According with AbpModuleZero 2.3 documentation https://aspnetboilerplate.com/Pages/Documents/v2.3.0/Feature-Management i would like to handle AbpAuthorizationException exception raised by a Controller decorated with the RequiresFeature attribute. For example, I would like to redirect to a static page or returning to home page. this is my controller implementation [AbpMvcAuthorize()] [RequiresFeature(AppFeatures.Trattative)] public class TrattativeController : BBWP_ABP_MPA_EFControllerBase {

PopUp not sending data in database in ASP.NET MVC 5 and Entity Framework

和自甴很熟 提交于 2020-01-16 10:09:12
问题 The popup code works just fine but after I add the credentials and click on the submit button to create the record nothing happens. I'm new to ASP.NET MVC 5 and Entity Framework 6. Any guidance will be most appreciated. @model IEnumerable <LogInTest1.Models.Credentials> @{var createModel = new LogInTest1.Models.Credentials();} @* I think I didn't do this part right *@ @{ ViewBag.Title = "Index"; } Here is the button code: <button class="btn btn-default" onclick="AddData()">Click to Create »<

Asp.Net MVC 5 + Bootstrap. How make inputs fit screen width?

人走茶凉 提交于 2020-01-16 04:33:45
问题 I really don't know what I'm doing wrong. I want my textboxes with same size of my buttons below. I already tried change a lot in the cshtml but without success. Below my cshtml file: @model SomeModel.Models.LoginViewModel <div class="row"> <div class="col-md-8 col-sm-12 col-xs-12"> <section id="loginForm"> @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() <hr />

Highcharts: Highmaps - Choropleth maps - All states are the same color

戏子无情 提交于 2020-01-16 02:06:24
问题 I have copied the demo code for the United States color axis map from the Highcharts website and substituted my own JSon file of values. The values are showing up in the tooltip and the legend has color gradients and values, but the states are all one medium blue color. The file values range from a few hundred to almost $4 million dollars for the states. This html page is being called in MVC5. <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="https://code.highcharts.com/maps

ASP.Net MVC 5 - Deploy separate CDN site with bundled JavaScript and CSS

孤者浪人 提交于 2020-01-15 16:52:14
问题 I was wondering whether it is possible to deploy two ASP.Net MVC sites to do the following. Main Website: contains all the controllers and views CDN website: contains all the JavaScript and CSS (bundles JS and CSS that is consumed by the first site) I was expecting that in the solution you would have two website projects. I think in debug mode this would work fine because the bundle names are consistent. However, in production where you are not running in debug mode (turned off in web.config)

ASP.Net MVC 5 - Deploy separate CDN site with bundled JavaScript and CSS

人盡茶涼 提交于 2020-01-15 16:49:06
问题 I was wondering whether it is possible to deploy two ASP.Net MVC sites to do the following. Main Website: contains all the controllers and views CDN website: contains all the JavaScript and CSS (bundles JS and CSS that is consumed by the first site) I was expecting that in the solution you would have two website projects. I think in debug mode this would work fine because the bundle names are consistent. However, in production where you are not running in debug mode (turned off in web.config)

Update entity with ViewModel and Entity Framework 6?

半世苍凉 提交于 2020-01-15 05:40:12
问题 I've been looking around and can't quite find the answer. I'm using a ViewModel in my Edit View so that I can have values for some dropdownlist. Now when I go to update my DB I'm not understanding how I can update my database record. I'm guessing I could create a new entity object, do a Find, and then update each property based on the ViewModel passed in from the Form but that sure seems like a lot of manual work. Here I'm using the VeiwModel in the Edit View. @model CPPCustomerCall

Update entity with ViewModel and Entity Framework 6?

北城以北 提交于 2020-01-15 05:40:09
问题 I've been looking around and can't quite find the answer. I'm using a ViewModel in my Edit View so that I can have values for some dropdownlist. Now when I go to update my DB I'm not understanding how I can update my database record. I'm guessing I could create a new entity object, do a Find, and then update each property based on the ViewModel passed in from the Form but that sure seems like a lot of manual work. Here I'm using the VeiwModel in the Edit View. @model CPPCustomerCall

MVC5 Where to put authentication forms in web.config?

感情迁移 提交于 2020-01-15 05:38:09
问题 Following this title, in my web.config, it's generated by VS 2012. Now, i don't know where i put the below code in web.config through i saw someone put it in <system.web> but in my web.config it have only <system.web.webPages.razor> and <system.webServer> . When i put this code somewhere in web.config I get an error at <authentication mode="Forms"> : There's code : <authentication mode="Forms"> <forms loginurl="~/Comfirm/Login" timeout="2880"></forms> </authentication> 回答1: You are putting it

Can't connect to Database to execute Identity functions

眉间皱痕 提交于 2020-01-15 03:52:54
问题 I've created a new application with ASP.NET MVC5, using Individual User Accounts for security and Code-First Migrations for the Models/Database modeling. All options are default. I want to setup custom Users and Roles to it, so i created a Seed using RoleManager and UserManager just to populate the Database. It works fine, create 3 Users, 3 Roles and set each User's Role correctly. I can log in to the application correctly. The problem is that i can't execute any Identity method using the