MVC ASP.Net Multiple Choice Questions and Answers pdf free download for freshers and Experienced :-
1. Which is the best approach to assign a session in MVC?
A) System.Web.HttpContext.Current.Session["LoginID"] =7;
B) Current.Session["LoginID"] =7;
C) Session["LoginID"] =7;
D) None
B) Current.Session["LoginID"] =7;
C) Session["LoginID"] =7;
D) None
2. RedirectToActionPermanent() Method for which Status code represents?
A) 304
B) 302
C) 301
D) 300
E) None
B) 302
C) 301
D) 300
E) None
3. RedirectToAction() Method for which Status code represents?
4. What is ActionResult() ?
A) It is an abstract Class
B) It is a Concrete Class
C) Both A and B
D) None
B) It is a Concrete Class
C) Both A and B
D) None
5. What is ViewResult() ?
A) It is an abstract Class
B) It is a Concrete Class
C) Both A and B
D) None
B) It is a Concrete Class
C) Both A and B
D) None
6. return View() works like in ASP.Net MVC C# as
A) Server.Transfer()
B) Response.Redirect()
C) Both A and B
D) None
B) Response.Redirect()
C) Both A and B
D) None
7. RedirectToAction() works like in ASP.Net MVC C# as
A) Server.Transfer()
B) Response.Redirect()
C) Both A and B
D) None
B) Response.Redirect()
C) Both A and B
D) None
8. In which format data can be return from XML into table ?
A) DataSet
B) Datatable
C) A and B
D) None
B) Datatable
C) A and B
D) None
9. Can we use view state in MVC ?
A) Yes
B) No
C) Both A & B
D) None
B) No
C) Both A & B
D) None
10. What Request Processing technique follows ASP.Net ?
A) Top-Down
B) Down-Up
C) Pipeline
D) Water fall
B) Down-Up
C) Pipeline
D) Water fall
11. What is DRY principle in ASP.Net ?
A) Don't repeat yourself.
B) Don't revise yourself.
C) both a and b
D) None
B) Don't revise yourself.
C) both a and b
D) None
12. What is default authentication in Internet Information Services (IIS)?
A) Standard User
B) Administrator
C) Anonymous
D) None
B) Administrator
C) Anonymous
D) None
13. What is the extension of MVC view when using C#?
A) cshtml
B) vbhtml
C) None
D) Both A & B
B) vbhtml
C) None
D) Both A & B
14. What is the extension of MVC view when using vb.net?
A) cshtml
B) vbhtml
C) None
D) Both A & B
B) vbhtml
C) None
D) Both A & B
15. How can you comment using Razor Syntax?
A) *@ Comment me *@
B) @* Comment me *@
C) @* Comment me @*
D) *@ Comment me @*
E) None
B) @* Comment me *@
C) @* Comment me @*
D) *@ Comment me @*
E) None
16. Which Namespace is used for Razor View Engine ?
A) System.Web.Razor
B) System.Web.Mvc.WebFormViewEngine
C) Both A & B
D) None
B) System.Web.Mvc.WebFormViewEngine
C) Both A & B
D) None
17. Which Namespace is used for ASPX View Engine ?
18. The Razor View Engine uses to render server side content.
A) @
B) <%= %>
C) Both A & B
D) None
B) <%= %>
C) Both A & B
D) None
19. The ASPX View Engine uses to render server side content.
A) @
B) <%= %>
C) Both A & B
D) None
B) <%= %>
C) Both A & B
D) None
20. Which is more faster between ASPX View Engine and Razor View Engine.
A) ASPX View Engine
B) Razor View Engine
C) Both A & B
D) None
B) Razor View Engine
C) Both A & B
D) None
21. Does Razor Engine supports for TDD ?
A) Yes
B) No
C) None
B) No
C) None
22. Does ASPX View Engine supports for TDD ?
A) Yes
B) No
C) None
B) ViewBag.ECMDetail = "my message"; and in view ViewBag.ECMDetail
B) ViewBag.ECMDetail = "my message"; and in view ViewBag.Title
D) None
2) Action filters
3) Response filters
4) Exception filters
B) No
C) None
22. How to Print value from Controller to View in MVC ?
A) ViewBag.ECMDetail = "my message"; and in view @ViewBag.ECMDetailB) ViewBag.ECMDetail = "my message"; and in view ViewBag.ECMDetail
B) ViewBag.ECMDetail = "my message"; and in view ViewBag.Title
D) None
23. If you have already implemented different filters then what will be order of these filters?
1) Authorization filters2) Action filters
3) Response filters
4) Exception filters
24. Can you specify different types of filters in ASP.Net MVC application?
1) Authorization filters (IAuthorizationFilter)
2) Action filters (IActionFilter)
3) Result filters (IResultFilter)
4) Exception filters (IExceptionFilter)
2) Action filters (IActionFilter)
3) Result filters (IResultFilter)
4) Exception filters (IExceptionFilter)
25. What are the advantages of using ASP.NET routing?
Answer: Clean URLs is originally brought from Ruby on Rails. http://www.technologycrowds.com?abc=10 , now clean URL in MVC ASP.Net will be work like http://www.technologycrowds.com/abc/10
26. What is the significance of ASP.NET routing?
Answer: Default Route Name:
"{controller}/{action}/{id}", // URL with parameters
By default routing is defined under Global.asax file. MVC ASP.Net uses routing to map between incoming browser request to controller action methods.
"{controller}/{action}/{id}", // URL with parameters
By default routing is defined under Global.asax file. MVC ASP.Net uses routing to map between incoming browser request to controller action methods.
27. Can be it possible to share single view across multiple controllers in MVC?
Answer: We can put the view under shared folder, it will automatically view the across the multiple controllers.
B) No
C) Both A & B
D) None
B) No
C) Both A & B
D) None
B) No
C) Both A & B
D) None
B) No
C) Both A & B
D) None
B) No
C) Both A & B
D) None
B) No
B) No
B) No
C) Both A & B
B) No
C) Both A & B
B) No
B) No
Syntax
B) var _controller = HttpContext.Current.Request.RequestContext.RouteData.Values["Controller"].ToString();
C) var _controller = RouteData.Values["Controller"].ToString();
D) None
B) It checks for valid Model State using DataAnnotations.
C) It checks for SQL database state.
D) None
B) using System.Web.Helpers;
c) using System.Web.Chart;
D) All
B) new Chart(width = 600, height = 400)
C) new Chart(width: 600, height: 400)
D) All
B) new Chart(width: 600, height: 400, theme: ChartTheme = Vanilla3D)
C) new Chart(width: 600, height: 400, theme: Vanilla3D)
D) None
B) .AddTitle("My First Chart")
C) .AddTitle('My First Chart')
D) All
B) .AddSeries(chartType: "Bar", xValue = xValue, yValues = yValue)
C) .AddSeries(chartType: "Bar", xValue: xValue, yValues: yValue)
D) None
B) .Series(chartType: "Bar")
C) .AddSeries(chartType: "Bar")
D) All
B) Write("bmp");
C) .Write("bmp");
D) All
B) using System.Net;
C) using System.Mail;
D) None
B) Replace @ to @@ (double)
C) None
D) Both (A & B)
B) @Html.HiddenFor(m => m.Name, new { Value = "Jack"})
C) @Html.Hidden(m => m.Name, new { Value = "Jack"})
D) None
B) var errors = ModelState.SelectMany(v => v.Errors);
C) var errors = ModelState.Values.SelectMany(v => v.Errors);
D) None
B) App_Start
C) Content
D) Filters
B) App_Start
C) Content
D) Filters
B) App_Start
C) Content
D) Filters
B) App_Start
C) Content
D) Filters
B) App_Start
C) Content
D) Filters
B) Authorization filters
C) Response filters
D) Exception filters
B) Authorization filters
C) Exception filters
D) Response filters
28. Are MVC and Web API merged into one in MVC 6?
A) YesB) No
C) Both A & B
D) None
29. Does MVC 6 introduced new JSON project based structure?
A) YesB) No
C) Both A & B
D) None
30. Does MVC 6 allow only save change, hitting the save but then refreshing the browser to reflect changes?
A) YesB) No
C) Both A & B
D) None
31. Does vNext is now Open Sourced via the .NET Foundation and open to public contributions.
A) YesB) No
C) Both A & B
D) None
32. Can vNext runs on both Mac and Linux today (Mono Version)?
A) YesB) No
C) Both A & B
D) None
33. What is the difference between MVC (Model View Controller) and MVP (Model View Presenter)?
Answer: MVC controller handles all the requests, MVP handles as the handler and also handles the all requests as well.
B) Viewstart is used like Masterpage in traditional forms (ASP.Net pages).
C) Viewstart render first in the views.
D) A, B and C.
E) None
B) Account
C) Shared
D) Home
B) No
C) Both A & B
D) None
B) _Layout.cshtml
C) _Login.cshtml
D) None
34. How does work Viewstart in MVC (ASP.Net)?
A) Viestart is used to layout of the application.B) Viewstart is used like Masterpage in traditional forms (ASP.Net pages).
C) Viewstart render first in the views.
D) A, B and C.
E) None
Viewstart Code Snippet
@{ Layout = "~/Views/Shared/_Layout.cshtml"; }
35. Viewstart comes under which folder name ?
A) ViewsB) Account
C) Shared
D) Home
36. Does Viewstart override all Views layout/template under "Views" folder in MVC ?
A) YesB) No
C) Both A & B
D) None
37. What is the name of default Viewstart Page in ASP.Net MVC ?
A) _ViewStart.cshtmlB) _Layout.cshtml
C) _Login.cshtml
D) None
38. Can we use third party View Engine using ASP.Net MVC Engine ?
Yes, below are the top five alternative ASP.Net MVC View Engines.- Spark (Castle MonoRail framework projects), Open Sourced, it is popular as MVCContrib library.
- NHaml works like inline page templating.
- NDjango uses F# Language.
- Hasic uses VB.Net, XML.
- Bellevue for ASP.NEt view, It respects HTML class first.
39. What is scaffolding using ASP.Net MVC Engine?
Answer: Scaffolding helps us to write CRUD operations blend using Entity Framework, It helps developer to write down simply even yet complex business logic.
40. What is life cycle in ASP.Net MVC Engine?
Step 1: Fill Route (Global.asax file will hit first).
Step 2: Fetch Route: It will gether information about controller and action to invoke.
Step 3: Request context
Step 4: Controller instance: it calls Controller class and method.
Step 5: Executing Action: It determines which action to be executed
A) @Html.Partial("_PartialHeader")
B) @Html.PartialView("_PartialHeader")
C) @Html.PartialHtml("_PartialHeader")
D) B and C
E) None
B) System.ComponentModel.DataAnnotations
C) Both A and B
D) None
42. Which Namespace is used to "Display" in Data Annotation using MVC ?
A) System.ComponentModelB) System.ComponentModel.DataAnnotations
C) Both A and B
D) None
43. Which Namespaces are required to Data Annotation using MVC ?
A) System.ComponentModel
B) System.ComponentModel.DataAnnotations
C) Both A and B
D) None
B) No, these (TempData/ViewData) does not require type casting.
C) Both A) & B)
D) None
B) No
C) Both A) & B)
D) None
B) No
C) Both A) & B)
D) None
B) No
C) Both A) & B)
D) None
B) No
C) Both A) & B)
D) None
44. Are both TempData/ViewData require typecasting in MVC?
A) Both (TempData/ViewData) requires type casting to avoid null exception.B) No, these (TempData/ViewData) does not require type casting.
C) Both A) & B)
D) None
45. Is ViewBag slower than ViewData in MVC?
A) YesB) No
C) Both A) & B)
D) None
46. Is ViewData faster than ViewBag in MVC?
A) YesB) No
C) Both A) & B)
D) None
47. Are both TempData/ViewData property of Controller base class in MVC?
A) YesB) No
C) Both A) & B)
D) None
48. Does TempData used to pass data from one page to another page in MVC?
A) YesB) No
C) Both A) & B)
D) None
49. Can ASP.Net Web API specialize to XML or JSON ?
A) YesB) No
C) None
50. Does Web API (ASP.Net) supports to non SOAP based like XML or JSON ?
A) YesB) No
C) None
51. Does Web API (ASP.Net) supports to both version mobile apps and others ?
A) YesB) No
C) Both A & B
D) None
52. Can ASP.Net Web API, it works HTTP standard verbs like POST, GET, PUT, DELETE (CRUD Operations) ?
A) YesB) No
C) Both A & B
D) None
53. Can ASP.Net Web API ability to both self hosting (outside of IIS) and IIS ?
A) YesB) No
C) None
54. Can ASP.Net Web API has ability to transport non HTTP protocols like TCP, UDP, Named Pipes etc ?
A) YesB) No
C) None
B) AuthConfig.cs is used to configure security settings including sites oAuth Login.
C) None
D) All
B) BundleConfig.cs in MVC is used to register bundles used by the bundling and minification, serveral bundles are added by default like jQuery, jQueryUI, jQuery validation, Modernizr, default CSS references.
C) All
D) None
B) FilterConfig.cs is used to register global MVC bundles.
C) None
D) All
B) RouteConfig.css is used to register global MVC bundles.
C) None
D) All
B) @Html.TextBox is strongly typed, @Html.TextBoxFor is not strongly typed that is why should be use @Html.TextBox in MVC Razor Engine.
C) None
D) Both A and B
55. What is AuthConfig.cs in ASP.Net MVC ?
A) AuthConfig.cs is used to configure route settingsB) AuthConfig.cs is used to configure security settings including sites oAuth Login.
C) None
D) All
56. What is BundleConfig.cs in ASP.Net MVC ?
A) BundleConfig.cs in MVC is used to register filters for different purposes.B) BundleConfig.cs in MVC is used to register bundles used by the bundling and minification, serveral bundles are added by default like jQuery, jQueryUI, jQuery validation, Modernizr, default CSS references.
C) All
D) None
57. What is FilterConfig.cs in ASP.Net MVC ?
A) FilterConfig.cs is used to register global MVC filters, HandleErrorAttribute is registered by default filter. We can also register other filters.B) FilterConfig.cs is used to register global MVC bundles.
C) None
D) All
58. What is RouteConfig.cs in ASP.Net MVC?
A) RouteConfig.cs is used to register MVC config statements, route config.B) RouteConfig.css is used to register global MVC bundles.
C) None
D) All
59. What is the difference between HtmlTextbox and HtmlTextboxFor using ASP.Net MVC Razor Engine?
A) @Html.TextBox is not strongly typed, @Html.TextBoxFor is strongly typed that is why should be use @Html.TextBoxFor in MVC Razor Engine.B) @Html.TextBox is strongly typed, @Html.TextBoxFor is not strongly typed that is why should be use @Html.TextBox in MVC Razor Engine.
C) None
D) Both A and B
Syntax
@Html.Partial("_viewname");
60. What is the benefits of Html.RenderPartial using ASP.Net MVC Razor Engine?
A) @Html.RenderPartial Returns response, moreover requires to create action.
B) @Html.RenderPartial Returns nothing (void), it is faster than @Html.Partial, moreover requires not to create action.
C) None
D) Both A and B
Syntax
@Html.Partial("_viewname");
@Html.RenderPartial("_viewname");
61. What is the benefits of Html.Partial using ASP.Net MVC Razor Engine?
A) @Html.RenderPartial Returns response, moreover requires to create action.
B) @Html.RenderPartial Returns string value, it is slower than @Html.RenderPartial, moreover requires not to create action.
B) @Html.RenderPartial Returns string value, it is slower than @Html.RenderPartial, moreover requires not to create action.
C) None
D) Both A and B
Syntax
@Html.Partial("_viewname");
62. How to check Request coming from which controller using MVC ASP.Net?
A) var _controller = HttpContext.Current.Request.RequestContext.Values["Controller"].ToString();B) var _controller = HttpContext.Current.Request.RequestContext.RouteData.Values["Controller"].ToString();
C) var _controller = RouteData.Values["Controller"].ToString();
D) None
63. For which ModelState.IsValid Validate ?
A) It checks for Entityframework Model state.B) It checks for valid Model State using DataAnnotations.
C) It checks for SQL database state.
D) None
64. Which Name space is used to create chart using ASP.Net MVC?
A) using System.Web.MVC;B) using System.Web.Helpers;
c) using System.Web.Chart;
D) All
65. How can we provide Height and Width to MVC Charts ?
A) new Chart(width - 600, height - 400)B) new Chart(width = 600, height = 400)
C) new Chart(width: 600, height: 400)
D) All
66. How can we set theme to MVC Charts?
A) new Chart(width: 600, height: 400, theme: ChartTheme.Vanilla3D)B) new Chart(width: 600, height: 400, theme: ChartTheme = Vanilla3D)
C) new Chart(width: 600, height: 400, theme: Vanilla3D)
D) None
67. How can we give Title to MVC Charts?
A) var chart = AddTitle("My First Chart")B) .AddTitle("My First Chart")
C) .AddTitle('My First Chart')
D) All
68. How can we add Series to MVC Charts?
A) .AddSeries(chartType: "Bar", xValue: xValue, yValues: yValue)B) .AddSeries(chartType: "Bar", xValue = xValue, yValues = yValue)
C) .AddSeries(chartType: "Bar", xValue: xValue, yValues: yValue)
D) None
69. How can we add Chart Type to MVC Charts?
A) .NewSeries(chartType: "Bar")B) .Series(chartType: "Bar")
C) .AddSeries(chartType: "Bar")
D) All
70. How can we write Chart output to MVC View?
A) .Write(bmp);B) Write("bmp");
C) .Write("bmp");
D) All
71. How can we Show Chart output to MVC View?
Answer: C)72. Which name space using can send email in ASP.Net MVC?
A) using System.Net.Mail;B) using System.Net;
C) using System.Mail;
D) None
MailMessage mail = new MailMessage();
73. If Razor View Engine need to add JQuery function and contain @ special character then how we can write it in Razor View?
A) Replace @ to @@@ (tripple)B) Replace @ to @@ (double)
C) None
D) Both (A & B)
74. How to set Default Value to Hidden Input Box using ASP.Net MVC?
A) @Html.HiddenFor(m => m.Name, "Jack")B) @Html.HiddenFor(m => m.Name, new { Value = "Jack"})
C) @Html.Hidden(m => m.Name, new { Value = "Jack"})
D) None
75. How to check all errors of Model using ASP.Net MVC?
A) var errors = Model.Values.SelectMany(v => v.Errors);B) var errors = ModelState.SelectMany(v => v.Errors);
C) var errors = ModelState.Values.SelectMany(v => v.Errors);
D) None
76. AuthConfig.cs file is under in which App folder ?
A) App_DataB) App_Start
C) Content
D) Filters
77. BundleConfig.cs file is under in which App folder ?
A) App_DataB) App_Start
C) Content
D) Filters
78. FilterConfig.cs file is under in which App folder ?
A) App_DataB) App_Start
C) Content
D) Filters
79. RouteConfig.cs file is under in which App folder ?
A) App_DataB) App_Start
C) Content
D) Filters
80. WebApiConfig.cs file is under in which App folder ?
A) App_DataB) App_Start
C) Content
D) Filters
81. Can you list the main types of result using ASP.Net MVC?
There are total 10 main types of result, ActionResult is main type and others are sub types of results as listed below:- System.Web.Mvc.ActionResult
- System.Web.Mvc.ContentResult
- System.Web.Mvc.EmptyResult
- System.Web.Mvc.FileResult
- System.Web.Mvc.HttpStatusCodeResult
- System.Web.Mvc.JavaScriptResult
- System.Web.Mvc.JsonResult
- System.Web.Mvc.RedirectResult
- System.Web.Mvc.RedirectToRouteResult
- System.Web.Mvc.ViewResultBase
82. Which filter will be execute at first using ASP.Net MVC?
A) Action filtersB) Authorization filters
C) Response filters
D) Exception filters
83. Which filter will be execute at last using ASP.Net MVC?
A) Action filtersB) Authorization filters
C) Exception filters
D) Response filters
thanks a lot
ReplyDeletethank you So much . Helped a lot :)
ReplyDeletethanks for posting (*all question answer! very helpfull)
ReplyDelete61. What is the benefits of Html.Partial using ASP.Net MVC Razor Engine?
ReplyDeleteB) @Html.RenderPartial Returns string value, it is slower than @Html.RenderPartial, moreover requires not to create action.
please correct it.
Html.Partial() Html.RenderPartial()
DeleteHtml.Partial returns html string. Html.RenderPartial returns void.
Html.Partial injects the html string of the partial
view into the main view. Html.RenderPartial writes html in the response stream.
Performance is slow. Perform is faster compared with HtmlPartial().
Html.Partial() need not to be inside the braces. Html.RenderPartial must be inside braces @{ }.
these mcqs are really helpful and informative
ReplyDelete
ReplyDeleteMy name is Leah Brown, I'm a happy woman today? I told myself that any loan lender that could change my life and that of my family after having been scammed separately by these online loan lenders, I will refer to anyone who is looking for loan for them. It gave me and my family happiness, although at first I had a hard time trusting him because of my experiences with past loan lenders, I needed a loan of $300,000.00 to start my life everywhere as single mother with 2 children, I met this honest and God fearing online loan lender Gain Credit Loan who helped me with a $300,000.00 loan, working with a loan company Good reputation. If you are in need of a loan and you are 100% sure of paying the loan please contact (gaincreditloan1@gmail.com)
Inconsistency in output quality: If the provider {you have chosen|you've chosen|you've selected|you have selected} is inexperienced and lacks consistency, {then it|it|this|that} {might lead to|could trigger|might trigger|may cause} problems {such as|for example|including|like} delayed submission of completed projects, processed files without accuracy and quality, inappropriate assignment of responsibilities, {lack of communication|no communication|poor communication} {and so|and thus|therefore|so} on| While the job profile {might seem|may appear|may seem|might appear} simple {it does|it will|it can|it lets you do} {in fact|actually|in reality|the truth is} {require a|need a|demand a|have to have a} certain {degree of|amount of|level of|a higher level} exactness {and an|as well as an|plus an|with an} eye for detail| My writing {is focused|is concentrated|is targeted|concentrates} {more on|more about|read more about|on} {the industry|the|a|that is a} {and quality of|and excellence of|superiority} work, not the worker| By continues monitoring the hurdles and solving it, {one can|it's possible to|you can|one can possibly} easily {increase the|boost the|raise the|improve the} productivity of business| Decline {in the|within the|inside the|inside} quality of service and delay {in the|within the|inside the|inside} execution and delivery of processes are some {of the|from the|with the|in the} risks involved, {besides the|aside from the|in addition to the|apart from the} risk {to the|towards the|for the|on the} security {of the|from the|with the|in the} data and privacy and cost-related risks| The {service provider|company|supplier|vendor} {should also|also needs to|must also|also need to} volunteer {a variety of|a number of|many different|various} profits concerning formulas {of data|of information|of knowledge|of internet data} transmission, turnaround etc}. { A lot of companies are fine with admitting this, but {others are|other medication is|other people are} {not so|not too|not|less than} sure, primarily {because this|as this|since this|simply because this} may put people {off the|from the|off of the|over} service| Such measures would {keep your|keep the|maintain your|maintain} sensitive documents from falling {into the|in to the|to the|in the} hands of unauthorized personnel| When you outsource {to an|for an|to a|with an} experienced BPO company, {they would|they'd|they might|they will} manage these risks professionally {as well as|in addition to|along with|and also} plan and implement appropriate {strategies to|ways of|ways to|methods to} avoid them in future| Outsourcing data entry is most helpful term {for all|for those|for many|for all those} these organizations| With the help of such information, {you can|you are able to|it is possible to|you'll be able to} {improve on|enhance|make improvements to} customer targeting| If you think {you are|you're|you might be|you happen to be} proficient enough in installing the payment processor {on your|in your|on your own|on the} website {on your|in your|on your own|on the} own, {you should not|you shouldn't|you ought not|it's not necassary to} hesitate doing it}.pdf data entry services
ReplyDeleteThis is a great article loaded with unique information.I would like to comment on this quality content.Thank you for sharing.chice
ReplyDeleteIts a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. choice carts
ReplyDelete