How do I create a Blazor server-side application in Visual Studio 2019?

Follow the step-by-step procedure below to create a Blazor Server Application in Visual Studio 2019. Download and install Visual Studio 2019 Download and install the latest version of Visual Studio 2019 with the ASP.NET and web development workload. Create a new project Open Visual Studio 2019 and click Create a new project. Select Blazor app from the template Select Blazor App from the template list and click the Next button. Configuring the project The project configuration window will pop up. Click the Create button to create a new project with the default project configuration. Choose Blazor Server App Select a target framework based on your requirement, choose the Blazor Server App from the dashboard, and then click Create to create a new Blazor Server application. Blazor Server App structure Now the Blazor Server App is created, and the structure look like the following image. Run the application. Press Ctrl + F5 to run the application and find the output in default browser. Refer to this link for more details.

How do I create a Blazor WebAssembly application in Visual Studio 2019?

Follow the step-by-step procedure below to create a Blazor WebAssembly (client-side) application in Visual Studio 2019. Download and install Visual Studio 2019 Download and install the latest version of Visual Studio 2019 with the ASP.NET and web development workload. Create a new project Open Visual Studio 2019 and select Create a new project. Select Blazor app from the templateSelect Blazor App from the template list and click the Next. Choose Blazor WebAssembly AppSelect a target framework based on your requirements, choose Blazor WebAssembly App from the dashboard, and then click Create to create a new Blazor WebAssembly application. Blazor WebAssembly App structureNow the Blazor WebAssemblyApp is created, and the structure look like in the below image. Run the application.Press ctrl + F5 to run the application and see the below output in default browser. Refer to this link for more details.

How do I localize data annotations in Blazor server-side and WebAssembly (client-side) applications?

Data annotation localization in Blazor server-side and WebAssembly (client-side) apps is achieved by referencing the Resource class localized string. Follow these steps to achieve this: Add the required localized error messages to the Resource file in the Resource folder. In the validation attribute, set the ErrorMessageResourceType as typeof(Resource). Assign the required validation message to the ErrorMessageResourceName property. [Index.razor]

How do I add UI features, such as smooth scrolling that are already available in jQuery UI components?

You can add smooth scrolling to a Blazor app using a combination of Blazor components and JavaScript interop, similar to the functionality available in jQuery UI components.   Step 1: Create a New Blazor App Run the following command to create a new Blazor WebAssembly app:   .NET CLI   dotnet new blazorserver -n SmoothScrollDemo  Step 2: Add CSS Styles Open the wwwroot/css/site.css file and add the following CSS class for smooth scrolling:  [wwwroot/css/site.css]   Step 3: Create a SmoothScroll Component Create a new Blazor component named SmoothScroll.razor:   [SmoothScroll.razor] Step 4: Add the following JavaScript function for scrolling to the bottom of the page in _Host.cshtml.  [_Host.cshtml] Step 5: Test the Smooth Scrolling Effect Run the Blazor app using the following command: NET CLI  dotnet run  View Sample in GitHub  

How do I modify the current culture date format in Blazor Server and Blazor WebAssembly apps?

DateTime.Now.ToShortDateString() and DateTime.Now.ToLongDateString() are methods that return the current culture date format. The string returned by the ToShortDateString and ToLongDateString methods are culture-sensitive. It reflects the pattern defined by the current culture’s date format. You can get the current culture date format by using either of the following methods. or