33,318 questions
1
vote
0
answers
34
views
Embedded Views in ASP.NET Core 10
Previously, in .NET 9 and lower, we could use RazorRuntimeCompiliation to implement embedded views in assemblies.
services.Configure<MvcRazorRuntimeCompilationOptions>( options =>
{
var ...
-1
votes
0
answers
48
views
Why can PropertyColumns not infer their type parameters when passed to a wrapper? [duplicate]
I am using MudBlazor's MudDataGrid, which functions very similarly to Blazor's QuickGrid. The grid's contents are determined by a RenderFragment parameter called Columns, which contains a list of ...
0
votes
0
answers
52
views
TLS issues with ActionMailer.Net [duplicate]
I have an ASP.NET MVC application, that uses the following package
ActionMailer.net
This has been going beautifully for many years, but lately we have been hitting issues with the mail servers we have ...
-3
votes
1
answer
77
views
Error with onblur, There is no argument given that corresponds to the required parameter 'e' [closed]
I get the error,
There is no argument given that corresponds to the required parameter
'e' of 'AddContributor.OnPayerIdChangedAsync(ChangeEventArgs)'
This is the pertinent area of blazor markup:
<...
1
vote
0
answers
51
views
How to disable the pink Razor feature warnings in Visual Studio?
I'm working on an ASP.NET Core MVC project in Visual Studio 2022.
Lately, I keep seeing these warning messages at the top of the editor:
Feature 'Razor Diagnostics Feature' is currently unavailable ...
3
votes
4
answers
140
views
Why does this Razor code compile even though I reuse the same loop variable name in nested foreach
I am writing a Blazor component and noticed something unexpected. In my Razor code, I use a foreach to loop over a list, and inside the Click event handler of a RadzenButton I declare another foreach ...
2
votes
2
answers
125
views
Build error after adding a TypeScript file to a Razor Class Library project
(With Visual Studio 17.14.13) Steps to reproduce (sorry this is a bit long but these are the fewest steps I could find):
From the command line, create the solution folder:
md test1
cd test1
Create ...
1
vote
1
answer
51
views
ASP.NET Core MVC: How to make simple page with IEnumerable<XML>
I have a simple project where the start page shows a list of books. How to make the same page, but with display as XML?
Controller method:
public IActionResult Index()
{
// stored procedure
...
1
vote
0
answers
32
views
Want to modify the Middleware in razor page to redirect to SessionExpired Page once application times out
I have following AutoLoginMiddleware in my intranet razor page application and want to modify the middleware to redirect to SessionExpired page purposedly once it times out after 30 min (auth cookie ...
0
votes
2
answers
100
views
Errors while compiling Razor content
This is a follow up on Cannot compile a Razor document.
I get several errors while compiling a Razor content (not a file). The code is like this:
var content = File.ReadAllText("RazorComponent....
0
votes
1
answer
59
views
Cannot compile a Razor document
I am trying to compile a Razor document for which I have the contents, not the file.
Here are my steps:
var content = File.ReadAllText("RazorComponent.razor");
var document = ...
1
vote
0
answers
53
views
Singleton / cascading scoped service using SignalR hub
I have an app where I want to centralise a notification service. With hardware sending out updates of it current status as it changes.
There are a number of separate components which need to react to ...
0
votes
0
answers
39
views
Razor 9 select dropdown does not show value of model
I am unable to configure a select dropdown to display the value of the model property. I am working from scaffolded pages where i need to use a different control than what the scaffolder chose.
I am ...
0
votes
0
answers
42
views
set conditional tooltip on Kendo UI Grid column
The conditional tooltip is not working on kendo UI Grid column.
The following code is not applying the condition for title and instead showing the whole text
'#= (!IsSynced && !AddressNickname....
1
vote
1
answer
65
views
Creating a Razor component from a string
Razor components are normally loaded from .razor files. Behind the scenes, they implement the IComponent interface (or one of its implementations).
What I'd like to know is, can we build a Razor ...
1
vote
2
answers
195
views
input forms or class properties with Required attribute not stopping ajax call
This has been a slow step-by-step process for me, but I'm getting there.
My modal popup has two input forms that need to be filled out before the ajax call is executed. I've tried a few options, ...
0
votes
2
answers
58
views
Change default width of jquery dialog popup in CSHML?
I've been searching for a way to increase the width of the modal popup in my cshtml, but haven't been able to. I tried the suggestions in this SO question, but none worked.
Here's my code. Doesn't ...
0
votes
5
answers
113
views
Display several cells per row?
I'm learning how to use razor, so please bear with me.
I'm trying to create a simple grid that shows our products. Each row will display several products, and each product will display the name, the ...
0
votes
0
answers
24
views
ASP.NET Razor Send HTTP Request via HttpClient and include JWT Auth Browser cookies
I have a WebApi and Razor frontend project (both using .Net 8.0). I'm trying to learn to implement authentication using JWT and cookies.
As of now it is working well:
Login on my razor website, which ...
0
votes
0
answers
53
views
DataTable is always empty in ASP.NET MVC
I am working with jQuery datatables, but the datatable is always empty when the page loads. On inspecting the network tab, the request returns an empty response but when debugging the controller ...
0
votes
0
answers
24
views
How to treat RazorLight templates as Razor views at build-time for validation, but use RazorLight at runtime?
I'm working on an ASP.NET clean architecture project that uses Azure Functions to send emails. The email templates are stored in Services/EmailService/Template/ with each template using @model to bind ...
0
votes
1
answer
68
views
'HttpNavigationManager' not initialized when rendering static HTML
I'm trying to generate HTML to a string from a Razor component. I use the following code to do that:
var html = await _htmlRenderer.Dispatcher.InvokeAsync(async () =>
{
var pv = ...
0
votes
0
answers
22
views
Indexing a collection in CSHTML in ASP.NET Core MVC [duplicate]
I have the following Entity Framework tables:
ChildFile:
- Id (PK)
- ParentId (FK)
- FileName (string)
- [NotMapped] FileEntry (IFormFile)
Parent:
- Id (PK)
- ChildFiles (ICollection&...
0
votes
1
answer
133
views
How to inherite from MudDebouncedInput and overwrite DebounceInterval
I'm using Blazor with MudBlazor.
I'm using the MudTextField very often and have also some validations in some places.
Now i would like to create a new component which inherits from the MudTextField ...
0
votes
1
answer
100
views
Blazor Collocate js and cs files
It is possible to collocate a .js file and a related .razor file as described here.
Is there a way to collocate a .js file and .cs file in a similar way? I imagine it looking similar to this:
...