4 Creating Asp Net Core Mvc Applications

NET Centric Computing · Unit 4 · 10 hrs

Creating ASP.NET core MVC applications

Exam-focused notes for Creating ASP.NET core MVC applications (NET Centric Computing, CSC378): what the TU syllabus asks and how it has actually been tested, with 9 solved past questions from this unit.

What this unit covers

  • Setting up the Environment
  • Controllers and Actions: Create Controllers, Create Actions and Action Results Types
  • Rendering HTML with Views: Razor Syntax
  • Understanding Tag Helpers
  • Models: Binding and Validations
  • URL Routing and features
  • Web API Applications: API Controllers, JSON
  • Dependency Injection and IOC containers

Controllers and Actions

208110 marks

How do you create controller? Illustrate with an example. Describe the procedure of rendering HTML with Razor with scenario.[10]

"Controller handles the user request. Typically the user uses the view, processes request and raises an HTTP request. Controller is the request handler." A Controller is a C class that: - Handles incoming HTTP requests - Interacts with the Model (data) - Re...

Full solved answer →
20805 marks

How do you create controller? Mention some requirements for rendering HTML. [5]

A Controller is the central unit of an ASP.NET MVC application that combines the Model with a View and serves the result to the end-user. It handles user requests, executes application logic, builds a model, and returns the result in HTML, JSON, XML, or oth...

Full solved answer →

Rendering HTML with Views

20815 marks

How does ASP.NET core MVC provides patterns-based way to build dynamic website? Explain. [5]

ASP.NET Core MVC is the Model-View-Controller application model that can be merged with the new ASP.NET Core. It is used to build dynamic websites as it provides fast development. ASP.NET MVC gives a powerful, patterns-based way to build dynamic websites th...

Full solved answer →

Dependency Injection and IOC containers

20815 marks

Describe the life cycle of Dependency Injection container. [5]

In ASP.NET Core, the built-in IoC (Inversion of Control) container manages the creation and lifetime of service instances. The lifetime of a service defines how long an instance lives and when a new instance is created. There are three main service lifetime...

Full solved answer →
20805 marks

Mention the two types of services managed by IoC container and how they are registered? [5]

The built-in IoC container in ASP.NET Core supports three kinds of service lifetimes, of which the two most commonly highlighted types are: --- - The IoC container creates and shares a single instance of a service throughout the application's lifetime. - Th...

Full solved answer →
20795 marks

What does dependency injection and IOC container means? Explain. [5]

Dependency Injection is a design pattern used to achieve loose coupling between classes and their dependencies. Instead of a class creating its own dependencies (objects it needs), those dependencies are provided (injected) from outside the class, typically...

Full solved answer →

Understanding Tag Helpers

20805 marks

What are tag helpers? What tag helper provides? [5]

Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files. Tag Helpers are authored in C and they target HTML elements based on: - The element name - The attribute name - The parent tag Tag Helpers are similar...

Full solved answer →
20795 marks

What is tag helper? Discuss about razor syntax with an example. [5]

Definition: Tag Helpers enable server-side code to participate in creating and rendering HTML elements in Razor files. They are similar to HTML Helpers but follow a more natural HTML-like syntax. Key Points (from notes): - Tag Helpers are authored in C and ...

Full solved answer →

Setting up the Environment

20765 marks

What are the ASP requirements?[5]

ASP.NET (Active Server Pages .NET) is a web application framework developed by Microsoft for building dynamic web applications and services. To develop and run ASP.NET applications, the following requirements must be met: --- - ASP.NET applications require ...

Full solved answer →