Professional Documents
Culture Documents
ASP
ASP
used for developing web applications and services, is a free and open-source web framework created by
Microsoft.
Server-side (ASP.NET): Handles data processing, business logic, and dynamic content generation.
Front-end (HTML, CSS, JavaScript): Provides the visual layout and interactive elements experienced by
the user.
Classic ASP
ASP.NET MVC
ASP.NET API
ASP.NET Core
Classic ASP pages have the file extension .asp and are normally written in VBScript.
Test-Driven Development
Model objects are parts of the application which implement the logic for the application’s data domain.
Views are the components which are used to display the application’s user interface (UI) also called view
model in MVC. It displays the .Net MVC application’s which is created from the model data.
Controllers handle user reguests interaction, work with the model, and select a view to render that
display Ul.
Complex applications are easy to manage because of divisions of Model, View, and Controllers.
Actions are only a spatial types of methods that for writing the code for a specific task and then is also
responsible for returning something to the user and that can be a page/partial page (User Controls).
[HttpGet]
[HttpPost]
actions are only called when there is a previously view on the client-side
APP_DATA APP_START
CONTENT CONTROLLERS
FONTS MODELS
SCRIPTS VIEWS
Additional folders
Global.asax
Packages.config
Web.config
2. what is uses of App_Data?
The App_Data folder can contain application data files like LocalDB, .mdf files,
The App_Start folder can contain class files that will be executed when the application starts.
The Content folder contains static files like CSS files, images, and icons files.
The Controllers folder contains class files for the controllers. A Controller handles users' request and
returns a response.
The Fonts folder contains custom font files for your application.
The Scripts folder contains JavaScript or VBScript files for the application.
Global.aspx file allows you to write code that runs in response to application-level events,
such as Application_BeginRequest, application_start, application_error, session_start, session_end,
Packages.config file is managed by NuGet to track what packages and versions you have installed in the
application
routing in MVC
ASP.NET introduced Routing to eliminate the needs of mapping each URL with a physical file.
You can register a route in RouteConfig class, which is in RouteConfig.cs under App_Start folder.
The URL pattern is considered only after the domain name part in the URL.
6. Write ASP.NET MVC code that registers a defoult rout for HomeController and Index action?
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "HomeDefault",
url: "{controller}/{action}/{id?}",
);
7. Write ASP.NET MVC code that registers multiple routes for HomeController and StudentController?
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "HomeDefault",
url: "{controller}/{action}/{id?}",
routes.MapRoute(
name: "StudentDetails",
url: "students/{studentId}/details/{action}",
);
controller questions
what is controller?
Financial Controller
what is scaffolding?
controller challenges
// GET: home
return View();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MVC_BasicTutorials.Controllers
// GET: Student
{
return View();
model questions
In this section, you will learn about the model class in ASP.NET MVC framework.
The model classes represents domain-specific data and business logic in the MVC application.
In the MVC application in Visual Studio, and right-click on the Model folder,
select Add -> and click on Class... It will open the Add New Item dialog box.
In the Add New Item dialog box, enter the class name Student and click Add.
model challenges
{
Public INT STUDENID { get; set; }
View questions
The Shared folder contains views, layout views, and partial views, which will be shared among multiple
controllers.
List the types of razor view files? And what each supports?
// GET: Student
return View();