0% found this document useful (0 votes)
7 views4 pages

Testpaperonmvc

Uploaded by

vishakha kesare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views4 pages

Testpaperonmvc

Uploaded by

vishakha kesare
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 4

Question paper on mvc

1- what is asp.net mvc

Ans : ASP.NET MVC is a web development framework provided by


Microsoft as part of the ASP.NET platform. It implements the Model-View-
Controller architectural pattern to create dynamic and scalable web
applications.

2- what is model , view and controller

Ans : Model - The Model represents the data and the business logic of the
application. It is responsible for managing the data, processing user inputs,
and performing Tasks. It is relation with database ceratin updation re retrival
data will be updated through model .

Views: Views is visual representation it is presentatation layere in whichich


user can see and perform cetatin user applications .

controller - Controller is the intermediate between the model and views .It
receive input from the user and perform ceratin application . It receives user
inputs from the View, processes them, and updates the Model accordingly. It
also updates the View with the changes in the Model.

3 what are different asp.net validation annotations

Ans: ASP.NET MVC provides a set of data annotation attributes that you can
use to validate your model data. These annotations help ensure that the data
entered by users is valid and meets specific criteria before it is processed.

Validation can happen on both the client side and the server side

Client-side validation provides immediate feedback without refreshing the


page, while server-side validation ensures security .
Some input validations :

[Required] -Ensures that a field must have a value It cannot be empty.

[StringLength] - Specifies the minimum and/or maximum length of a string.

[Range] - Ensures that a value falls within a specified range.

[Email address ] – check a proper email address.

[phone no] – check a valid number type

[compare] – compare two values in feilds

4 what is asp.net mvc routing

Ans: Routing in ASP.NET MVC maps the web addresses to specific


functions in your application called controller actions. This is how the
application knows what code to run when a user click to a particular URL.

When user nevigate to a perticular url the requesent send to the routing
before the controller , requested url check in route table then the matching
url will send request in specific controller then controller perfom next
function according that .

5 ASP.NET MVC Scaffolding Concept

Ans: Scaffolding is an automated way to generate code for your application.


It helps speed up development by creating the basic structure and boilerplate
code needed for common operations like creating, reading, updating, and
deleting data (CRUD operations).

6 What is Loosely Typed Html Helper

Ans: Loosely Typed HTML Helpers are methods that create HTML elements
without being directly tied to your model's properties. They use string
parameters to define the names and values of these elements. This means
they don't check if the names you use match any properties in your model
until the application runs.

Ex textbox
7 What is Strongly Typed Html Helper.

Ans: Strongly Typed HTML Helpers are methods that use lambda
expressions and strongly typed model data. They provide compile-time
checking, meaning that errors can be caught during development, making
them safer and more reliable.

Ex TextboxFor

8 What is ASP.NET MVC Entity Framework.

Ans: ASP.NET MVC Entity Framework is a powerful tool that helps


developers interact with databases in an easy and efficient way. It is part of
the ASP.NET framework, which is used to build web applications.

9 What are different Entity Framework Approaches.

ANS: there are certain approches in ASP.NET MVC :

1 code first : in the code first approch you will start wrinte first code and
accorfing to the classes EF will generate database schema .

2 database first : In the Database First approach, you start with an


existing database and generate the EF model from it.

3 Model first : in Model first create model First then generate the
database scema according to the model .

10 what is viewbag, viewdata and tempdata

Ans: ViewData: ViewData is a dictionary object that allows you to pass data
from a controller to a view. It requires typecasting to access the data.

ViewBag: ViewBag is a dynamic object that allows you to pass data from a
controller to a view without needing to define a strongly-typed class. It uses
dynamic properties, so you don’t need to cast types. It only lasts for the
duration of the current request.
Once the request sent to the client the data will be loss
TempData: A dictionary object used to pass data between Controller actions.
The data in TempData persists until it is read. Once read, the data is
removed. It survives multiple requests as long when it is not been read.

You might also like