Asp.Net Razor Pages By Sagar Jaybhay

Asp.Net Razor Pages

In article we will understand Asp.Net Razor Pages By Sagar Jaybhay. Asp.Net MVC we have 3 different components Controller, Model, and View. In Asp.Net razor pages we have only two components 1) Display template and 2) Page Model Class. Page model class has OnGet and OnPost methods. Which are worked as the Controllers’ action method in MVC? The properties which you write in Page Model class are available in the Display template file of that class. When you create Razor application you can see Index and Privacy are default files…

Read More

Need to Know RoleManager Asp.Net Core 2019

Asp.net-core By Sagar Jaybhay

Previous article links :- https://sagarjaybhay.com/asp-net-core/ RoleManager In Asp.Net Core For this, we have a RoleManager class to Create Read Update Delete The roles and we use this conjunction with userManager class and for this, we have to pass IdentityUser object. For saving role identity created one table for it in a database which is the AspNetRoles table. First, we create a view model for creating role and for that we create rolename field in our model. After this, we create a view for that and in this view, we use…

Read More

Custom Validation Attribute Asp.Net Core 2019

Asp.net-core By Sagar Jaybhay

Complete Asp.Net Core Tutorial Step By Step :-https://sagarjaybhay.com/asp-net-core/ How to Create Custom Validation Attrbute Asp.Net Core? Built-in Validation Attribute Required Range StringLength RegularExpression Compare Etc.. When in your project we have some requirements that can not be full fill with some in-built validation attributes then we need to create some Custom validation attribute. In this, we have created one CustomValidator class which inherits from ValidationAttribute inbuilt class. After inheriting from this we need to override the IsValid method. Now in our example, we have to achieve the functionality of we…

Read More

Tutorial:Asp.Net Core Razor Pages

Asp.Net Core Razor Page Logo

Asp.Net Core Razor Pages What are Asp.Net Core Razor Pages in asp.net core? Asp razor pages are page focused framework for building a dynamic data-driven application. These razor pages are built on top of asp.net core framework so it is cross-platform. The asp.net core razor pages are the recommended framework for building cross-platform server-side Html. It uses the C# programming language. As razor pages cross-platform support you can develop anywhere and can be published on Unix, Mac, and Linux also. Asp.Net Core Razor Pages who will use? It is for…

Read More

How to implement Client-Side Validation in Asp.net Core?

Asp.net-core By Sagar Jaybhay

Client-Side Validation – By Sagar Jaybhay A client-side validation means validation perform on client machine or in browser of client. First, server-side validation is performed or validate using Validation attributes like Required, String Length, etc. But when we perform server-side validation there is a round trip to a server over the network. In such situation if our server is busy with another heavy processing task or either busy to serve another request so it will send result to user but it required some time and if your application needs to…

Read More

What Is an Open Redirection Vulnerability & How to Prevent it?

Asp.net-core By Sagar Jaybhay

Open Redirection An Open Redirection is when a web application or server uses a user-submitted link to redirect the user to a given website or page. How I identify is my application vulnerable or not? If your application redirects to URL which is directly given by user that’s specified via the request such as query string or form data. The redirection is performed without checking if the URL is a local URL. Below is the code for that In this code we pass this URL directly to the Redirect we…

Read More