All Questions
Tagged with razor asp.net-core-mvc
693
questions
0
votes
1
answer
45
views
How to populate CreateGroupViewModel
I'm having trouble with inputting value into a ViewModel as it keep returning null after the value is inputted via cshtml.
Value I input in cshtml
After hitting confirm
CreateViewModel.cs
public ...
0
votes
1
answer
29
views
Memory leak after adding AddApplicationPart and EmbeddedFileProvider
I have an ASP.NET Core 8.0 application where I want to move some controllers into a module (separate project). To accomplish this I had to update the startup from:
services.AddControllersWithViews()
...
0
votes
1
answer
63
views
Text input into List in cshtml
How can I turn a text input separated by comma in html into a list of a model that I created and add the values into a sql-table
Models
public class Person
{
[Key]
public string PersonId { get;...
1
vote
1
answer
63
views
ASP.NET Core MVC web app : antiforgery tokens
I am wondering if anyone can help me. I am trying to get [ValidateAntiForgeryToken] action method to fire and it appears not be. I was trying to check if the anti forgery token logic was actually ...
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
1
answer
66
views
Passing an IEnumerable<Entity> from view to controller in ASP.NET Core 8 MVC
This is my view:
@model IEnumerable<HourlyLimit>
<html>
<head><title></title></head>
<body>
<form method="post" action="~/...
1
vote
1
answer
29
views
I represent many products in view but the return of all them in controller is the first product I use ASP.NET Core 6 MVC
I represent many projects correctly but It's return the same object in controller specifically the first item in database
In controller:
public IActionResult AddToBasket(ProductsModel products)
{
...
0
votes
0
answers
50
views
@Html.ListBoxFor setting the initial selected item
I have a web page which has a listbox which is correctly populated as below
@Html.ListBoxFor(model => model.Item, ViewBag.Ingreds as SelectList,
new { @id = "...
0
votes
1
answer
80
views
The id returns null each time
I am trying to change the information of the material and the way I've tried to do it is there is a list of all materials and within the div of the particular method I have put a change material ...
0
votes
0
answers
49
views
File returning IActionResult works on local but not when deployed
I have this code which i create a pdf and then return it to show. It works on my local, it opens pdf as result of that controller but when i publish it deploy to hosting same url gives HTTP500 error ...
0
votes
0
answers
57
views
Facing problem updating multiple existing items of data in the database from backend in ASP.NET Core
I'm currently working on an ASP.NET Core application where I need to update a list of holidays in the database, including dynamic holidays based on user input. However, I'm encountering some issues ...
0
votes
0
answers
24
views
ASP.NET Core MVC : NullReferenceException: Object reference not set to an instance of an object [duplicate]
I'm working on the contoso university project, in the students section there's a section where the user can create a new student for the university. I'm trying to add a checkbox list of all the ...
0
votes
1
answer
39
views
Prevent modal from popping up when freeze button is clicked
Basically, I need to create a clickable row where i can click the row and then the user details can be shown. However, when i click freeze button, which is inside the row within a tag, the detail ...
1
vote
2
answers
47
views
ASP.NET Core MVC invoke function through button on razor page
I have a .cshtml page that displays some information about a racing session. At the bottom I want to add a button that invokes a function getting drivers of that session to the database and redirects ...
1
vote
1
answer
34
views
Why does my ASP.NET Core MVC application add some identifier to HTML elements?
When running my new ASP.NET Core MVC application and viewing it in the browser, it seems ASP.NET Core added some kind of ID to some HTML elements.
I'm using .NET 6, and Razor .cshtml pages.
Why? And ...