Relative Content

Tag Archive for blazorblazor-server-side

Web app – How can I handle events from a user synchronously?

I have a Blazor Interactive Server app. On several of my pages I have a component where the user can register for an event. There are 4 buttons (No, Undecided, Interested, Attending). When they click the button, that fires an event that reads 2 records from the DB, updates them with the signup status, and saves them.

Purpose of Layout.cshtml in Blazor server app

Coming from an MVC background, I cannot understand the purpose of Layout.cshtml in a Blazor app. There is also a MainLayout.razor. I know one is a view (cshtml) and another is a component (.razor). But if razor components can’t be used within views, I don’t understand the point of the Layout.