Skip to main content

Posts

Showing posts with the label Asp.net core 3.0

Blazor WebAssembly Dynamic Form Validation

Introduction: In Blazor WebAssembly(client-side framework) form validation can be done with Data Annotations. Using Data Annotations we can validate form either by default validation attributes or by creating custom validation attributes. Using this Data Annotation attribute we can dynamically add or remove validation on a specific field in a form. Create Blazor WebAssembly Project: To create a Blazor WebAssembly template project need to install the latest version of VisualStudio 2019 for rich intelligence support or we can use VisualStudio code but less intelligence support from the editor.  Click here to know about Blazor WebAssembly template creation. Blazor WebAssembly is in preview mode, not yet ready for production. Create Razor Component: After creating a sample project using the Blazor WebAssembly template, in "Pages" folder add new Razor Component , name it as "UserForm.razor" Add Route: In Blazor routing can be configured using @