ASP.NET CORE Installing Bootstrap

ASP.NET Core MVC
[quads id=RndAds] Installing BootstrapIn video will discuss and see example of how to install the bootstrap in asp.net core mvc.There are different tools available that you can use to install client-side packages such as JQuery and Bootstrap using Visual Studio. Some of the popular tools are as follows.BowerNPMWebPackLibrary Manager, etc.In this tutorial we are going to use Library Manager which is known as Libman to install the client-side packages.The Library Manager or LinMan is one of the most popular light-weight, client-side library acquisition tool. This tool is basically used to download the client-side libraries and frameworks such as Bootstrap and JQuery from a file system or from a CDN (Content Delivery Network). In order to use Library Manager, you should have Visual Studio 2017 version 15.8 or later version.Follow below…
Read More

Model validation in asp.net core

ASP.NET Core MVC
[quads id=RndAds] Model Validation In ASP.NET CORE MVCIn this tutorial we will discuss how apply model validation in asp.net core. Will seeHow to apply validation on models.How to display error messages. How to display all error messages.How to customize the error message.What are Different types of validation?As of now we have created a form which saves the employee details but we have not added any validation so we want name, class and school name to be mandatory fields If the required values are not provided and the form is submitted we want to display required validation errors and the age field is not mandatory but when use enters value that must be integer.To make name, class and school name field a required field, we need to apply the Required attribute on…
Read More

Model binding in asp.net core

ASP.NET Core MVC
[quads id=RndAds] Model Binding In ASP.NET CORE MVC In this tutorial we will discuss Model Binding in ASP.NET Core with examples. Understand the binding to primitive type and binding to complex types.Model binding maps data in an HTTP request to controller action method parameters. The action parameters may be simple types such as integers, strings, etc or complex types like Customer, Employee, Order etc.Model binding is great, because without it we have to write lot of custom code to map request data to action method parameters which is not only tedious but also error prone.The model binding refers to converting the HTTP request data (from the query string or form collection) to an action method parameters. These parameters can be of primitive type or complex type.Binding to Primitive Type:When an HTTP…
Read More

Form Tag Helper In ASP.NET CORE

ASP.NET Core MVC
[quads id=RndAds] Form Tag Helper In ASP.NET CORE MVC In this tutorial will discuss about form tag helper and how to create forms in ASP.NET Core MVC. In ASP.NET CORE mvc when we want to create forms then require different tag helpers.In this tutorial will discuss how to create forms in ASP.NET Core MVC. In ASP.NET CORE mvc when we want to create forms then require different tag helpers.Form Tag HelperInput Tag HelperLabel Tag HelperTextarea Tag HelperRadio Button Tag HelperSelect Tag HelperAt the end of this tutorial, we will create a Form using the above Tag Helpers. This form is used to create a Student.Let's add action into the StudenController to add students. Will be called CreateStudent and we require get and post action. So the get action initializes the and…
Read More

Image tag helper in asp.net core mvc

ASP.NET Core MVC
[quads id=RndAds] Image Tag Helper In ASP.NET CORE MVCIn this tutorial we will discuss and understand about the image tag helper fin ASP.NET Core MVCThis topic is very important if your application requires it to display images. So let's start understand the why require the image tag helpersSo before jumping let's understand the concept of browser caching and will see how he relates to the image tag helpersBrowser CachingIn general, when you visit a web page and if that web page contains some image, then most of the modern web browser cache the images for later use. In the future, when you revisit to that web page, then the browser loads the images from cache instead of downloading the images from the server.Disable Browser Caching If you want then you…
Read More

Tag Helpers in asp.net core mvc

ASP.NET Core MVC
[quads id=RndAds] Tag Helpers In ASP.NET CORE MVCIn this tutorial we will discuss tag helpers in ASP.NET Core MVC and significant of tag helpers. Tag helpers are one of the new features introduced in ASP.NET Core MVC.Tag HelpersIn ASP.NET Core MVC, Tag Helpers are the server-side components. They are basically used to perform defined transformations on HTML Elements. As they are server-side components, so they are going to be processed on the server to create and render HTML elements in the Razor files.If you are coming from ASP.NET MVC background, then you may find the Tag Helpers are similar to the HTML helpers.Types of Tag Helpers:There are two types of Tag helpers in ASP.NET Core. They are as follows:Built-In Tag Helpers: They come in-built in the ASP.NET Core Framework and…
Read More

View Import in ASP.NET CORE

ASP.NET Core MVC
[quads id=RndAds] View Import In ASP.NET CORE In this tutorial we will discuss View Import in ASP.NET Core MVC.The ASP.NET Core MVC and Razor comes with a lot of new advanced features for working with the Razor views. ViewImports is one of the new features and will discuss usage and scenario.In ASP.NET Core MVC Application, the _ViewImports.cshtml file provides a way to include the directives globally for Razor Pages so that we don’t have to add them individually in each and every view. the _ViewImports.cshtml file supports the following directives:@addTagHelper@tagHelperPrefix@removeTagHelper@namespace@inject@model@usingThe @addTagHelper, @tagHelperPrefix, and @removeTagHelper directives are basically used to manage Tag Helpers. The @namespace directive is basically used to specify the namespace that the ViewImports belongs to. With the help of @inject directive, it supports Dependency injection. We already use the…
Read More

ASP.NET CORE MVC ViewStart

ASP.NET Core MVC
[quads id=RndAds] ASP.NET CORE Mvc - _ViewStart.cshtmlIn this tutorial we will discuss view start in a ASP.NET Core MVC. How apply layout to all views and apply multiple layouts.In ASP.NET Core MVC Application, the _ViewStart.cshtml file is a special file and the code present in this file is going to be executed before the code in an individual view is executed. So, you can set the Layout Property in this file instead of setting the Layout Property in each individual view which is going to be executed before the actual view is executed.Let's take an example, As of now we have assigned a layout page for a particular view but  suppose we have 50 views in our application and all the 50 views want to use the same layout file.…
Read More

ASP.NET CORE MVC Sections in Layouts

ASP.NET Core MVC
[quads id=RndAds] ASP.NET CORE Mvc - Sections In LayoutIn this tutorial we will discuss sections in a layout page in ASP.NET Core MVC and how to make use of section.In ASP.NET Core MVC, the layout view contains one or more sections in it. The Sections in a layout view are used to organize where certain page elements should be placed. The sections in a layout view can be optional or mandatory.To understand the section with example and use of section, we first create a subfolder within this with the name “js” under the wwwroot and then will add a javascript file with the name “custom.js” within the js folder.Now let's take scenario, If we have a custom javascript file (i.e. CustomJavascript.js) and that file is being required by all the…
Read More

ASP.NET CORE MVC Layouts

ASP.NET Core MVC
[quads id=RndAds] ASP.NET CORE Mvc - LayoutsIn this tutorial we going to discuss the Layout View in ASP.NET Core MVC Application and the Components of layouts.The layouts used to provide common UI functionality to all pages. This is like the master pages in webforms applications. The common UI code, which can be used in many views can go into a common view called layout.Now let's take an example: you have around 20 view created in your application and all views are required information like.Header/Menu HeaderFooterMain Contents.There might be other content like the left side menu and that is totally as per the requirement of your application or project.If you think you don’t have a layout view for your website, then you need to repeat the required HTML content for the…
Read More