| by Achyut Kendre | No comments

Authorize and AllowAnanymous Attributes in ASP.NET MVC 5

Example Code: https://drive.google.com/file/d/1vU4wNkp35Co8amL-_ZY6Z7HbVs2uj1yK/view?usp=sharing [Authorize] Attribute Authorize Attribute is built in attribute when applied on action or controller you can access that controller or action only after login. [AllowAnanymous] Attribute When you apply AllowAnanymous Attribute on any action and controller the action can be called without login even though controller is Authorized it can not be […]

Read More
| by Achyut Kendre | No comments

Action Filters In ASP.NET MVC 5? Few Built in Filters.

Example Code: https://drive.google.com/file/d/15OGfgD_p6pqZDOV8obhF4ykSYEAwhYTj/view?usp=sharing Filters/ Action Filters are the built in or user defined attributes those can be applied on action or controller which help you to execute some logic/code before execution of action or after execution of the action. Filters allow you to add pre and post logic to action which will be executed before […]

Read More
| by Achyut Kendre | 138 comments

What is Child Action Calls? How to in ASP.NET MVC 5?

Example Source Code: https://drive.google.com/file/d/1dkgkEq9WR1b1hlDks-pEy8Fx6YBdEEgX/view?usp=sharing What is Child Action Call? When we call any action and that action returns view so that action execution will be completed when a view is returned but before completion of view processing if we call any action in between from the view that is called child action call whoes result […]

Read More
| by Achyut Kendre | No comments

How to Create Partial View in ASP.NET MVC 5?

Example Source Code: https://drive.google.com/file/d/1dkgkEq9WR1b1hlDks-pEy8Fx6YBdEEgX/view?usp=sharing Partial view is view that can be reused or shared in another view. A partial view is a reusable portion of a web page. It is .cshtml or .vbhtml file that contains HTML/CSS/JAvaScript or server side code just like any other view. It can be used in one or more Views […]

Read More
| by Achyut Kendre | No comments

What is Antiforgery Token and How to use it in ASP.NET MVC?

Example Code: https://drive.google.com/file/d/1wc0fpPUD-pDI4fRB6dLIX4BxsDoIH5VC/view?usp=sharing To help prevent CSRF attacks, ASP.NET MVC uses anti-forgery tokens, also called request verification tokens. It verifies the tokens before accepting the request into ASP.NET MVC controller action which prevents the Cross Site Request Forgery. What is CRF? Cross-Site Request Forgery (CSRF) is an attack where a malicious site sends a request […]

Read More
| by Achyut Kendre | No comments

Curd Operations using Entity Framework Code First and ASP.NET MVC

Example Code: –https://drive.google.com/file/d/1G5oroBmfsy30_avDAlZrsy27KGPCBGRl/view?usp=sharing You can do the curd operations as we do it using DbFirst their is no change in it. Step 1: Index Action Code Index View Code with Index.cshtml Step 2 : to create the Emp we need to create the create action with HttpGet and HttpPost as follows – Step 3: You […]

Read More
| by Achyut Kendre | No comments

Entity Framework Code First Approach using ASP.NET MVC 5

Example Link: https://drive.google.com/file/d/1G5oroBmfsy30_avDAlZrsy27KGPCBGRl/view?usp=sharing What is Code-First? In the Code-First approach, you focus on the domain of your application and start creating classes for your domain entity rather than design your database first and then create the classes which match your database design. The following figure illustrates the code-first approach. The Code First Approach provides an […]

Read More
| by Achyut Kendre | No comments

ASP.NET MVC Scaffold Templates

Example Code : https://drive.google.com/file/d/1XQTimW39SuNI7kxrhvPmUQ_6MQlp34YC/view?usp=sharing Scaffolding is a technique used by many MVC frameworks like ASP.NET MVC to generate code for basic CRUD (create, read, update, and delete) operations against your model classes /database. For a view ASP.NET MVC provides you following templates – Empty Empty with Model List Create Edit Delete Details Empty template:- will […]

Read More
| by Achyut Kendre | No comments

How to Implement Validation in ASP.NET MVC? (Part 2)

Example Source Code: https://drive.google.com/file/d/18IPwYq1aujZ3waQHR0QTeeJvPp7By9H2/view?usp=sharing Other Attributes Data Type: this attribute will help you to define the data type of any model property which will be followed by helper while generating HTML in a view or ui, few data types are MultiLineText, Password, Credit Card, Url etc. Display: will help you to change the name of […]

Read More
| by Achyut Kendre | No comments

How to Implement Validation in ASP.NET MVC? (Part1)

Example Link : https://drive.google.com/file/d/1XRi7oC0jtIPRIFde7gw8XTTxX2iIP4yj/view?usp=sharing To implement a model validation in ASP.NET Core we need to use Data Annotation API. What is Data Annotation API in ASP.NET Core ? Data Annotation API is general purpose API provides you built in attributes those can be used for – Validation Data Types Display Rules Meta Data About Model […]

Read More