ASP.NET MVC MCQ
Soopro Pathshala provides ASP.NET MVC MCQ(Multiple Choice Questions)
1. Which of the following is not a feature of ASP.NET MVC?
a) Separation of Concerns
b) Testability
c) Built-in Authentication
d) View State
View Answer
2. Which of the following is not a valid HTTP method for an ASP.NET MVC action?
a) GET
b) POST
c) DELETE
d) PUT
View Answer
3. What is the purpose of routing in ASP.NET MVC?
a) To map URLs to controller actions
b) To manage session state
c) To authenticate users
d) To validate user input
View Answer
Answer: (a) To map URLs to controller actions
4. Which of the following is not a valid action result in ASP.NET MVC?
a) ViewResult
b) ActionResult
c) JsonResult
d) FileResult
View Answer
5. Which of the following is not a valid type of routing constraint in ASP.NET MVC?
a) Regex
b) Range
c) Length
d) Date
View Answer
6. Which of the following is not a valid Razor syntax in ASP.NET MVC?
a) @{}
b) @()
c) @[]
d) @if{}
View Answer
7. What is the extension of MVC view when using vb.net?
a) cshtml
b) vbhtml
c) None
d) both a & b
View Answer
8. How can you comment using Razor Syntax?
a) *@ Comment me *@
b) @* Comment me *@
c) @* Comment me @*
d) *@ Comment me @*
View Answer
Answer: (b) @* Comment me *@
9. Can we use view state in MVC ?
a) Yes
b) No
c) both a & b
d) none
View Answer
10. RedirectToAction() works like in ASP.Net MVC C# as
a) Server.Transfer()
b) Response.Redirect()
c) both a and b
d) none
View Answer
Answer: (b) Response.Redirect()
11. What is the purpose of the Partial View in an ASP.NET MVC application?
a) To display part of a view
b) To display a separate view
c) To display a separate controller action
d) To display a separate model
View Answer
Answer: (a) To display part of a view
12. Which of the following is a valid method of passing data between a controller action and a view in an ASP.NET MVC application?
a) ViewData
b) ViewBag
c) Model
d) all of the above
View Answer
Answer: (d) all of the above
13. Which of the following is NOT a valid ActionResult in an ASP.NET MVC application?
a) ContentResult
b) JsonResult
c) FileResult
d) StringResult
View Answer
14. What is ActionResult()?
a) It is an abstract class
b) It is a concrete class
c) both a and b
d) none
View Answer
Answer: (a) It is an abstract class
15. What is the extension of MVC view when using C#?
a) cshtml
b) vbhtml
c) none
d) both a & b
View Answer
16. Which Namespace is used for Razor View Engine?
a) System.Web.Razor
b) System.Web.Mvc.WebFormViewEngine
c) both a & b
d) None
View Answer
Answer: (a) System.Web.Razor
17. The Razor View Engine uses to render server side content
a) @
b) <%=%>
c) both a & b
d) none
View Answer
18. BundleConfig.cs file is under in which App folder?
a) App_Data
b) App_Start
c) Content
d) Filters
View Answer
19. RouteConfig.cs file is under in which App folder?
a) App_Data
b) App_Start
c) Content
d) Filters
View Answer
20. Who is developer of ASP.NET MVC?
a) Microsoft
b) Google
c) Facebook
d) none of these
View Answer