All Questions
Tagged with razor asp.net-core
2,723
questions
0
votes
2
answers
35
views
How to get container of model in EditorTemplate, ASP.NET Core 8.0
I'm looking for possibility to retrieve container in EditorTemplate (ASP.NET Core 8.0).
In .NET 4.6 there is property for that:
ViewData.ModelMetadata.Container
but there is no such property in .NET ...
1
vote
1
answer
32
views
Different authorization for one folder page than for the rest of the folder in ASP.NET Core Razor
Using ASP.NET Core identity, I'd like to allow an authorized user ability to change their password, but require the policy "Admin" access to access the other Account Manage pages.
However, ...
0
votes
1
answer
34
views
dropdown MVC don't keep focus for selected option
I have asp net core mvc application. After clicking filter controller recives propper data, but drop down always shows All option:
@{
ViewData["Title"] = "Index";
IsOpenFilterState ...
0
votes
0
answers
29
views
In one of the cshtml files,namespaces can not be found
I am using visual studio 2022 .net 6. All the other cshtml files within the same project are not showing any issues. Only in one cshtml file, the namespaces are not able to be found. All the ...
0
votes
1
answer
31
views
How do I use cshtml links inside a controller class?
I have an older ASP.NET Core 2.1 web app project.
I have a .cshtml page in this folder in my project:
G:\Projects\AccessApp\Pages\Privacy.cshtml
And I want to use it in my controller. I've tried the ...
0
votes
1
answer
39
views
How to avoid bootstrap labels to overflow the date picker input on .NET 8?
I'm following the Microsoft Identity tutorial on adding custom attributes to the identity user. I've added the proposed changes by the microsoft docs, however I'm getting a small visual error.
Code is ...
1
vote
1
answer
47
views
Conditional not working in ASP.NET Core 7 Razor view
I have a search function on my site, and one of the options the user has is to select the type of search.
So given this example in a view:
@using System.Data
@model DataSet
hello, world
<br />
@...
0
votes
1
answer
39
views
How to use razor renderer in .NET 6?
In my .NET 4.8 Web API application, I take an externally received HTML formatted string and convert it to a .cshtml file using Razor Engine, then append it to my page with JavaScript. I do this using ...
0
votes
1
answer
74
views
CSS for bootstrap accordion
So I'm pretty new to css and bootstrap, and have added an accordian into my view page. I have tried to alter the original css but with no luck!
<div class="accordion accordian-flush" id=&...
0
votes
1
answer
22
views
razor library loading views from different location
My app implements plugin system (razor libraries). App is using razor runtime compilation. Razor library contains few ViewComponents with custom structure described below.
Razor library structure:
...
0
votes
0
answers
41
views
Is it possible to create dynamic ASP.NET Core Razor view and controller file during runtime?
My requirement is to create dynamic razor view and controller save at project location at run time. If I call newly created controller then it will render newly created view also. The files are ...
0
votes
2
answers
86
views
How to update a table and refresh the partial view
I am using ASP.NET MVC and have a HomeController, model, and view. I am trying to create a search filter, where the user can type in some characters, click submit, and filter a table (in a partial ...
0
votes
0
answers
51
views
ASP.NET Core: how/where to call the SignOutAsync to logout from a custom authentication?
In an ASP.NET Core (razor pages) project I've implemented a custom authentication with a cookie that carries the custom claims, and I've specified login and logout pages/paths via the ...
1
vote
1
answer
44
views
Blazor 8 web app interactive server problem in sidebar javascript
Problem:
I created new project using blazor web app template wuth global settings as interactive server and i used many html templates with same problem, current project i am using sneat free html ...
0
votes
1
answer
65
views
ASP.NET Core: why is returning a Razor view + its model via a controller not the same of navigating to that Razor page?
I noticed that if you try to access the ViewData dictionary in a Razor view returned via a controller (return View("<RazorPageName>", new RazorPageNameModel())), it is null. This means ...