Skip to main content

All Questions

Tagged with
0 votes
2 answers
56 views

Form in foreach in Razor view: Validation is shown to all the elements

Consider the following Razor code foreach(Person p in Model.Persons){ <form> @Html.TextBoxFor(m => p.Name) @Html.ValidationMessageFor(m => p.Name) @Html....
Alessandro's user avatar
0 votes
2 answers
115 views

Creating a custom component in Blazor Server

I want to create a component that enables users to **autocomplete **from a list of plaintiffs, in addition to allowing them to **create **a new plaintiff if **no results **are found. I know that there ...
nebula79283's user avatar
0 votes
2 answers
61 views

Razor Component OnClick

I am learning asp and have come across blazor components. I am trying to bind to a buttons on click function, however when I look online I find funcitons that look like: <button @onclick="...
Lee's user avatar
  • 23
0 votes
1 answer
26 views

Selected Data not displaying when page loaded on Blazor app razor page select dropdown

In the below code, I have a <select> tag where I am binding the value of SelectedDate. When I load the timesheet-dashboard page, and select a value, it correctly navigates to the page. Logging ...
cursed banana's user avatar
0 votes
0 answers
66 views

Preventing Duplicate Tabs in Blazor WebAssembly

I'm working on a Blazor WebAssembly application and encountering an issue where the same page can be opened in multiple tabs if the user either copies the URL or modifies the link in the browser. I ...
neha's user avatar
  • 65
0 votes
1 answer
49 views

display errors in form from a controller base

I have implemented a login form that utilizes the login controller, which serves as a base controller. While the controller functions properly, my concern lies with error handling. Regrettably, I am ...
Lemon Grab's user avatar
2 votes
1 answer
66 views

What is the most appropriate default string value for a [Required] data annotation? [closed]

I'm learning model binding and validation for C# .NET 8 Razor Pages. I set up a simple input model to test validation (from ASP.NET Core Razor Pages in Action, Mike Brind): public class ...
canyon's user avatar
  • 33
0 votes
1 answer
266 views

Toggling between showing and hiding password on Blazor

I am wondering if it would be possible to create a toggle on an password input field to give the user the ability to toggle between the password being hidden or shown, without using a JavaScript ...
Dancing Diplodocus's user avatar
0 votes
0 answers
25 views

How can I get a scoped DataContext into DBLogger in .Net 8 Razor

I got a DBLogger implementing ILogger and also myDBLoggerProvider implementing ILoggerProvider in a Razor Project A. This requires a DataContext of type SysDataContextBase to be able to write logs ...
JPScerri's user avatar
  • 127
0 votes
1 answer
118 views

My Blazor Web App isn't reading any custom settings from appsettings.json

I placed a bunch of items in the "appsettings.json" file in my project. Both at startup in Program.cs, and on any Razor component page where I inject IConfiguration, they all come back with ...
Jay Imerman's user avatar
  • 4,591
0 votes
0 answers
18 views

Showing blazor component on button click [duplicate]

I am currently learning blazor and tried to modify the template to show weather on button click here is the code: @page "/" <PageTitle>Home</PageTitle> <h1>...
Asano Sparkle's user avatar
1 vote
1 answer
42 views

Nested ViewModel Not Being Populated When Form Is Submitted

I'm having a problem getting my nested view model to populate when the form is submitted. This is the parent view model. public class OverallViewModel { public int OrderNumber { get; set; } ...
CodeLearner's user avatar
0 votes
2 answers
780 views

Runtime Compilation of Razor Pages Does Not Work .NET 8 VS2022

I am having a hard time enabling runtime compilation of Razor pages under IIS v10.0, using Visual Studio 2022 17.8.8, .NET 8.0.103 (Windows 11). I have followed the instructions at https://learn....
Optimax's user avatar
  • 1,584
0 votes
1 answer
45 views

Question | Visual Studio Code Editor .cshtml file not working properly

I'm trying to create small app on .Net but i faced problem while working on .cshtml file. On this file, I cant format doccument and my property names not come automatically. For instance, ProductPrice ...
Mehmet Ali KÜÇÜK's user avatar
0 votes
1 answer
118 views

.Net 8 Blazor Web App how to map nonexisting urls to <NotFound> element

This is an Interactive WebAssembly Blazor Web app. When user click a link which a nonexisting url, I want the app goes the <NotFound> Element setup in the <Router>: The link like this: <...
KaraNoKara's user avatar

15 30 50 per page
1
2 3 4 5
90