asp.net-mvc

Asp.net MVC 5 MapRoute for multiple routes

爱⌒轻易说出口 提交于 2021-02-09 10:56:38
问题 I have 3 routes in RouteConfig: routes.MapRoute( name: "ByGroupName", url: "catalog/{categoryname}/{groupname}", defaults: new { controller = "Catalog", action = "Catalog" } ); routes.MapRoute( name: "ByCatName", url: "catalog/{categoryname}", defaults: new { controller = "Catalog", action = "Catalog" } ); routes.MapRoute( name: "ByBrandId", url: "catalog/brand/{brandId}", defaults: new { controller = "Catalog", action = "Catalog" } ); and this is my action controller receiving parameters:

Issue with updating model on AJAX “POST”

[亡魂溺海] 提交于 2021-02-09 07:30:36
问题 I'm trying to update my model without refreshing the page. I'm using a wysiwyg inline editor that I have on many places on my page. The editor can be placed anywhere on the page, it could look like this: <div id="1" class="click2edit">@Model.Header</div> <div id="2" class="click2edit">@Model.Content</div> Each editors div have a SaveButton that goes to this jquery, ajax below. What it does is: When I hit the save button for example the <div id="1" class="click2edit">@Model.Header</div> It

Seeding Many-To-Many data

元气小坏坏 提交于 2021-02-09 07:13:25
问题 Hello I'm trying to create some seeds for my project, but I'm having trouble seeding the Many-To-Many relationship data to the db. My database looks like this: in TeacherSkills , Teacher_ID and Skill_ID are foreign keys for their tables ofcourse. My seeder looks like this protected override void Seed(Ability_Examen_ASP.Models.AbilityDbContext context) { if (!context.Skills.Any()) { context.Skills.Add(new Models.Skill { SkillName = "PHP" }); context.Skills.Add(new Models.Skill { SkillName =

How to solve 'Cannot authenticate using Kerberos' issue doing EF Core database scaffolding in Linux(Ubuntu 18.04)? Are there any solutions?

走远了吗. 提交于 2021-02-09 01:47:28
问题 everyone. I've been trying to develop simple starting AspNetCore application with EntityFrameworkCore to connect and work with MS SQL server database. And manage all this by Rider IDE, tool for Database client(DBeaver) and dotnet command line interface(dotnet ef). I'm using database first approach(create database on mssql server, fill it with tables and then build Models based on tables). My STEP-by-STEP actions: 1)install and set up mssql server for my machine working on Ubuntu 18.04.

How to solve 'Cannot authenticate using Kerberos' issue doing EF Core database scaffolding in Linux(Ubuntu 18.04)? Are there any solutions?

自闭症网瘾萝莉.ら 提交于 2021-02-09 01:43:29
问题 everyone. I've been trying to develop simple starting AspNetCore application with EntityFrameworkCore to connect and work with MS SQL server database. And manage all this by Rider IDE, tool for Database client(DBeaver) and dotnet command line interface(dotnet ef). I'm using database first approach(create database on mssql server, fill it with tables and then build Models based on tables). My STEP-by-STEP actions: 1)install and set up mssql server for my machine working on Ubuntu 18.04.

To pass control values as html.Pagedlist parameters

梦想的初衷 提交于 2021-02-08 23:43:56
问题 I am using paged list to display a list of values. The display works fine. I use the provided Unobtrusive AJAX to get the data for the other pages. This is how my paged control looks. @Html.PagedListPager(Model.CountryList, page => Url.Action("GetCountries", "Dashboard", new {page}), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(PagedListRenderOptions.ClassicPlusFirstAndLast, new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "panel1", OnSuccess = "onAjaxSuccess", OnFailure =

To pass control values as html.Pagedlist parameters

混江龙づ霸主 提交于 2021-02-08 23:38:58
问题 I am using paged list to display a list of values. The display works fine. I use the provided Unobtrusive AJAX to get the data for the other pages. This is how my paged control looks. @Html.PagedListPager(Model.CountryList, page => Url.Action("GetCountries", "Dashboard", new {page}), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(PagedListRenderOptions.ClassicPlusFirstAndLast, new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "panel1", OnSuccess = "onAjaxSuccess", OnFailure =

To pass control values as html.Pagedlist parameters

爱⌒轻易说出口 提交于 2021-02-08 23:37:47
问题 I am using paged list to display a list of values. The display works fine. I use the provided Unobtrusive AJAX to get the data for the other pages. This is how my paged control looks. @Html.PagedListPager(Model.CountryList, page => Url.Action("GetCountries", "Dashboard", new {page}), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(PagedListRenderOptions.ClassicPlusFirstAndLast, new AjaxOptions() { HttpMethod = "POST", UpdateTargetId = "panel1", OnSuccess = "onAjaxSuccess", OnFailure =

MVC crazy property lose its value. Does Html.HiddenFor bug?

一个人想着一个人 提交于 2021-02-08 14:16:20
问题 There something really weird happening in my MVC application that drives me crazy. On my MVC Page, after a user got selected, it's Login should be "rendered" twice on the HTML. Once in the form of FrmNextStep('<Login>', ... (where Model.SelectedUser.Login is used) and once in the form of <input id="SelectedLogin" name="SelectedLogin" value="<Login>" type="hidden"> (where "Model".SelectedLogin is used) but the second one always stay blank. It's really weird because, despite the two call not

MVC crazy property lose its value. Does Html.HiddenFor bug?

╄→гoц情女王★ 提交于 2021-02-08 14:13:35
问题 There something really weird happening in my MVC application that drives me crazy. On my MVC Page, after a user got selected, it's Login should be "rendered" twice on the HTML. Once in the form of FrmNextStep('<Login>', ... (where Model.SelectedUser.Login is used) and once in the form of <input id="SelectedLogin" name="SelectedLogin" value="<Login>" type="hidden"> (where "Model".SelectedLogin is used) but the second one always stay blank. It's really weird because, despite the two call not