Category "razor"

How to Bind a List in Model with HTML Form in ASP.NET Core?

I'm unsure what I'm doing wrong when trying to map form values to my model, FieldMappingCollection. I've been able to get the Id and Name back for the model but

Blazor Hybrid App how to navigate to pages

How can I navigate between Razor pages in an Blazor Hybrid App? I found this explanation: https://docs.microsoft.com/en-us/aspnet/core/blazor/hybrid/routing?vie

Encoding issue when saving files with javascript?

i've been trying all day to setup a function that creates a file from plaintext or a stream in a razor page. i create csv plaintext in a backend and send it to

Is there a way to execute function before unloading razor view of _Layout asp.net core

I know that I can bind handler to onbeforeunload event and execute something before full page unload. But is there a way to do this on razor view of _Layout?

Does RuntimeCompilation of Razor templates on iOS work (with xamarin)?

For a project I have to know whether runtime compilation of razor templates on iOS (xamarin) devices would work. Right now I have no emulator or iOS device avai

Razor components - cascading parameter values

How do you pass a reference to the parent RenderingFragment to the child component/content when creating a razor component in c# (NOT using .razor) ComponentBas

How to show deserialized TempData object in view?

I'm getting System.NullReferenceException: 'Object reference not set to an instance of an object.' error in Index2.cshtml file after deserializing my TempData o

How to create NavMenu with collapsible submenu in .Net Core Blazor app

I am trying to create a blazor navmenu which has a shape like this item a item b when I click on item b it expands with sub menu like this and clicking on subi

Compilation error after publishing individual Razor page. Persists after publishing entire project. ("Compilation references may be missing")

Today I was working on a .NET Core 3.0 project (VS 2019). I added a CSS class to a <span> on one of my pages. That's it. Nothing else. I figured publishin

ASP.NET Core form ignoring asp-controller

I'm working on an ASP.NET Core application. Part of it is an image gallery which allows the user to upload images. On localhost this works as expected, but when

CSHTML WYSIWYG editor/previewer

I wanted to create an Asp.net Application, but I can't find a WYSIWYG editor in Visual Studio or even a Previewer, is the only way to see what your page looks l

Null Reference Exception when calling GraphServiceClient from a .net core Razor application that uses OpenIdConnect

I am working on a DotNet Core Razor application that uses OpenIdConnect to authenticate against Azure AD. This site is currently targeting the .net 5.0 framewor

ASP.NET MVC: Method for HttpPost is not executed

In an ASP.NET MVC application, I have a file MessageController.cs where I define EditMessage for access via HttpGet and HttpPost. Usually the user first accesse

Can c#/Razor work with DyGraph WITHOUT Javascript?

In this question: Previous DyGraph question There is still the need to go to JavaScript to call DyGraph: <script type="text/javascript"> g = new Dygraph

Button Click to return to the same page with same input parameters

I want users to navigate back to the same page after the button is clicked on the page. If the user URL is https://localhost:xxx/Inventories/Index/38?custID=38&

ASP.NET MVC (Razor) vs Angular 5

We are currently considering moving from ASP.NET MVC to Angular 5, mostly because it seems like the best and latest framework. However none of us seems to be ab

C# Razor partial view using an iFrame returns dictionary error "`1" and "`2"

I am attempting to load a partial view into an iFrame and receiving the below error. When loading the same partial not inside of a iFrame, there is no issue. Lo

How to render and preserve <br> tags as line breaks using @Html.TextAreaFor

I'm migrating an ASP Classic app to ASP.Net MVC 5. The legacy data contains <BR> tags in the text. In the old application (still in use) the tags are rend

CompilationFailedException during runtime compilation of Razor from AspNetCore TestHost

I have ASP.Net MVC application, one part of it is compiling razor views to string. The code is very similar to this example: https://long2know.com/2017/08/rend

How to load razor page before it's done rendering?

I have a table of records in Index.cshtml, once a user clicks on a record to view the details it will take them to Details.cshtml. The issue is, there is a lot