asp.net-mvc-5

Can I pass a dynamic query parameter to an embedded Power BI report in ASP.Net MVC?

£可爱£侵袭症+ 提交于 2020-05-14 11:54:08
问题 My question is in reference to the following documentation that is part of Power BI Embedded Query Parameters API at https://azure.microsoft.com/en-us/updates/power-bi-embedded-query-parameters-api/ "Note that the parameters are based on the dataset, so they are defined per report/dashboard, but not on the user’s session level. It means that different users who are using the same report at the same time will always see the same parameter’s value." We are planning to Embed dashboards created

Routing for a default document in MVC5, eliminating action from URL

梦想与她 提交于 2020-04-30 12:21:04
问题 I currently have a login area that is supposed to be the first page a logged-out user will visit. It is located at the Index action of a LoginController . Under default circumstances, this page would be accessed by visiting the URL: http://<url>.<tld>/Login/Index I'd like to make this page accessible from the root URL - http://<url>.<tld> . To achieve that, I assumed that the following rout configuration would suffice: routes.MapRoute( name: "Default", url: "", defaults: new { controller =

'router-outlet' is not a known element

送分小仙女□ 提交于 2020-04-07 13:52:56
问题 I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml I added a <base href="/"> and created my routing in my app.module. But when I run this I get the following error: Error: Template parse errors: 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module. 2. If 'router-outlet' is a Web Component then add 'CUSTOM

'router-outlet' is not a known element

╄→尐↘猪︶ㄣ 提交于 2020-04-07 13:48:28
问题 I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml I added a <base href="/"> and created my routing in my app.module. But when I run this I get the following error: Error: Template parse errors: 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module. 2. If 'router-outlet' is a Web Component then add 'CUSTOM

'router-outlet' is not a known element

谁都会走 提交于 2020-04-07 13:47:08
问题 I have a mvc 5 project with a angular frontend . I wanted to add routing as described in this tutorial https://angular.io/guide/router. So in my _Layout.cshtml I added a <base href="/"> and created my routing in my app.module. But when I run this I get the following error: Error: Template parse errors: 'router-outlet' is not a known element: 1. If 'router-outlet' is an Angular component, then verify that it is part of this module. 2. If 'router-outlet' is a Web Component then add 'CUSTOM

asp .net mvc 5 dropdownlist SelectList no validation attributes

﹥>﹥吖頭↗ 提交于 2020-03-16 08:59:34
问题 Inside model I have data annotations: [Required(ErrorMessageResourceName = "SelectCategory", ErrorMessageResourceType = typeof(MyProject.Properties.Resources)), Range(1, int.MaxValue, ErrorMessageResourceName = "SelectCategory", ErrorMessageResourceType = typeof(MyProject.Properties.Resources))] public int CategoryId { get; set; } public virtual Category Category { get; set; } and two situations: Situation1 Inside controller I have List<Category> categories = db.GetCategories(); ViewBag

MVC5 Lost value in Textbox after Submit

与世无争的帅哥 提交于 2020-02-24 11:08:28
问题 I would like to clarify one thing about MVC5 Razor Views. I was told that I don't have to use HTML Helpers (@Html.EditorFor, @Html.TextBoxFor) in my razor views and it will still work. Controller Code [HttpPost] public ActionResult Create(Models.TestObj obj) { ViewBag.TestStr = string.Format("You typed: {0} {1}", obj.FirstName, obj.LastName); return View(obj); } Razor View @using (Html.BeginForm()) { <div> @Html.EditorFor(model => model.FirstName, new { htmlAttributes = new { @class = "form

client.DeleteAsync - include object in body

可紊 提交于 2020-02-24 09:17:30
问题 I have an ASP.NET MVC 5 website - in C# client code I am using HttpClient.PutAsJsonAsync(path, myObject) fine to call a Json API (the API is also mine created in Web API). client.BaseAddress = new Uri("http://mydomain"); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); var response = await client.PutAsJsonAsync("api/something", myObj); I would like to do the same with a Delete verb. However client

Hangfire does not process recurring jobs unless dashboard is open

ぃ、小莉子 提交于 2020-02-21 12:01:16
问题 When I log into the server and open dashboard, it shows recurring jobs with the next execution in the past. Within seconds it triggers processes them automatically, but if I don't log in and open the dashboard, the recurring jobs are not triggered. It appears that Hangfire is running as expected and processing jobs. Why will it not trigger without me looking at it? 回答1: It's a usual problem if a Hangfire server runs in a web application . The jobs are not triggered because the web server has

“Trust relationship between … and the primary domain failed” in MVC5 Authentication

时光毁灭记忆、已成空白 提交于 2020-02-21 07:23:42
问题 I have a ASP .NET MVC5 application in which I am not using Windows Authentication. Everything was working fine until I tried running the application outside of the Domain in which it was being developed and (for whatever reason) got a: The trust relationship between this workstation and the primary domain failed. when I'm trying to do User.IsInRole("Admin") . I am using custom Identity , Role , IdentityStore , RoleStore , etc. from .NET's Identity and I can see that the User and Role data is