Questions tagged [razor]
Razor is a template language used by ASP.NET Web Pages, ASP.NET MVC (since version 3), and ASP.NET Core. It adds a layer of abstraction above HTML generation. It supports seamless transitions between HTML markup and C# or VB code. Transitions between markup and code are indicated by the "@" sign.
razor
33,301
questions
0
votes
0
answers
42
views
Array cannot be null. Parameter name: Bytes
I wrote a .NET Console application to migrate some data. Although the migration seems to complete successfully, the migrated data doesn't work as expected in my MVC project, which is also in .NET. The ...
0
votes
1
answer
16
views
razor model binding for one to many to many
I have an object called ChangeForm. This object has two related items called ChangeType and ChangeFormChangeType. For brevity ill show only the important parts.
/* public class ChangeType {
...
0
votes
1
answer
32
views
jquery validate make one field required if another field is not empty
I'm having some issues with jQuery.validate 1.11 , with .Net 4.8 and MVC 5 with Razor.
I have these two properties in my class:
[StringLength(500, ErrorMessage = "{0} can have a max of {1} ...
0
votes
2
answers
24
views
RadzenDataGrid does not reload after data property is updated or changed
I'm having a problem that I can't get my head around. I've read numerous articles online and nobody appears to have come across any solution which works for me.
Goal
I want to display a file selector, ...
0
votes
0
answers
53
views
How do I make the input type radio so that it can be checked?
I have the problem that when I insert the check to the first one and then I insert another one and the check is passed to the new one that is entered and the idea is that it stays there in the first ...
0
votes
0
answers
29
views
Blazor WASM ConfirmDialog with Asynchronous Data Fetching: Opacity Issue and NullReferenceException
I've got a Razor Component running on Blazor WASM. It sends an asynchronous request to the IoT device to get data type of some node. If it isn't the same as the stored one, I'll ask the user to update ...
0
votes
0
answers
9
views
Setting On in dropdown semantic ui don´t work
I'm trying in my dropdown, which already works, allowing it to only perform the search when the "Search" button is clicked.
I saw in the semantic Ui documentation that there is an "On&...
0
votes
1
answer
33
views
How to create dropdown in mvc to select object
As we can select object in angular, is there any way that I make asp.net Dropdown to select the object.
I have a list in which there is Id, CountryName, CurrencyCode. I want CurrencyCode to be ...
0
votes
2
answers
45
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 ...
0
votes
0
answers
11
views
DNN Razor Host Module - How to use a querystring parameter as a variable to get data related to a specific UserID
I need a syntax help to write the following code to use in Host Razor module on a dnn site version 9.13.
I need to use a querystring parameter as a variable to get data related to a specific UserID.
@...
2
votes
1
answer
38
views
Strange Strings in HTML Code of New ASP.NET Core Razor Projects in Visual Studio 2022
I'm encountering an issue when creating new ASP.NET Core web app (Razor) projects using Visual Studio 2022 (Community Edition 17.10.4) with .NET 8.0. Without making any modifications, I see strange ...
1
vote
1
answer
42
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
38
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
33
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
51
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 ...