InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What are the options can be configured in AJAX helpers? |
|
Answer» Below are the options in AJAX helpers :
|
|
| 52. |
What are AJAX Helpers in ASP.Net MVC? |
|
Answer» AJAX Helpers are used to create AJAX enabled elements like as Ajax enabled forms and links which performs the request asynchronously and these are extension methods of AJAXHelper class which exists in namespace - System.Web.ASP.Net MVC. |
|
| 53. |
What are HTML Helpers in ASP.Net MVC? |
|
Answer» HTML Helpers are like controls in traditional web forms. But HTML helpers are more lightweight compared to web controls as it does not hold viewstate and events.HTML Helpers returns the HTML string which can be directly rendered to HTML page. Custom HTML Helpers also can be created by overriding "HtmlHelper" class. |
|
| 54. |
Explain TempData in ASP.Net MVC? |
|
Answer» TempData is again a key, value pair as ViewData. This is derived from "TempDataDictionary" class. TempData is used when the data is to be used in two consecutive requests, this could be between the actions or between the controllers. This requires typecasting in view. |
|
| 55. |
What is the difference between ViewBag and ViewData in ASP.Net MVC? |
|
Answer» ViewBag is a wrapper around ViewData, which allows to create dynamic properties. Advantage of viewbag over viewdata will be :In ViewBag no need to typecast the objects as in ViewData.ViewBag will take advantage of dynamic keyword which is introduced in version 4.0. But before using ViewBag we have to keep in mind that ViewBag is slower than ViewData. |
|
| 56. |
What is ViewData? |
|
Answer» Viewdata contains the key, value pairs as dictionary and this is derived from class : "ViewDataDictionary". In action method we are setting the value for viewdata and in view the value will be fetched by typecasting. |
|
| 57. |
Which are the important namespaces used in ASP.Net MVC? |
|
Answer» Below are the important namespaces used in ASP.Net MVC -
|
|
| 58. |
How route table has been created in ASP.NET ASP.Net MVC? |
|
Answer» Method : "RegisterRoutes()" is used for registering the routes which will be added in "Application_Start()" method of global.asax file, which is fired when the application is loaded or started. |
|
| 59. |
Explain Bundle.Config in ASP.Net MVC4? |
|
Answer» "BundleConfig.cs" in ASP.Net MVC4 is used to register the bundles by the bundling and minification system. Many bundles are added by default including jQuery libraries like - jquery.validate, Modernizr, and default CSS references. |
|
| 60. |
Explain Dependency Resolution? |
|
Answer» Dependency Resolver again has been introduced in ASP.Net MVC3 and it is greatly simplified the use of dependency injection in your applications. This turn to be easier and useful for decoupling the application components and making them easier to test and more configurable. |
|
| 61. |
Explain JSON Binding? |
|
Answer» JavaScript Object Notation (JSON) binding support started from ASP.Net MVC3 onwards via the new JsonValueProviderFactory, which allows the action methods to accept and model-bind data in JSON format. This is useful in Ajax scenarios like client templates and data binding that need to post data back to the server. |
|
| 62. |
How to enable Attribute Routing? |
|
Answer» Just add Model.CustomerName the method : "MapASP.Net MVCAttributeRoutes()" to enable attribute routing as shown below: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); //enabling attribute routing routes.MapASP.Net MVCAttributeRoutes(); //convention-based routing routes.MapRoute ( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Customer", action = "GetCustomerList", id = UrlParameter.Optional } ); }
|
|
| 63. |
What is Attribute Routing in ASP.Net MVC? |
|
Answer» ASP.NET Web API supports this type routing. This is introduced in ASP.Net MVC5. In this type of routing, attributes are being used to define the routes. This type of routing gives more control over classic URI Routing. Attribute Routing can be defined at controller level or at Action level like : [Route("{action = TestCategoryList}")] - Controller Level[Route("customers/{TestCategoryId:int:min(10)}")] - Action Level
|
|
| 64. |
What are Actions in ASP.Net MVC? |
|
Answer» Actions are the methods in Controller class which is responsible for returning the view or json data. Action will mainly have return type : "ActionResult" and it will be invoked from method : "InvokeAction()" called by controller. |
|
| 65. |
What you mean by Routing in ASP.Net MVC? |
|
Answer» Routing is a pattern matching mechanism of incoming requests to the URL patterns which are registered in route table. Class : "UrlRoutingModule" is used for the same process. |
|
| 66. |
What is the use of View Model in ASP.Net MVC? |
|
Answer» View Model is a plain class with properties, which is used to bind it to strongly typed view. View Model can have the validation rules defined for its properties using data annotations. |
|
| 67. |
What is the meaning of Unobtrusive JavaScript? Explain us by any practical example. |
|
Answer» This is a general term that conveys a general philosophy, similar to the term REST (Representational State Transfer). Unobtrusive JavaScript doesn't inter mix JavaScript code in your page markup.Eg : Instead of using events like onclick and onsubmit, the unobtrusive JavaScript attaches to elements by their ID or class based on the HTML5 data- attributes. |
|
| 68. |
What is Separation of Concerns in ASP.NET ASP.Net MVC? |
|
Answer» It is the process of breaking the program into various distinct features which overlaps in functionality as little as possible. ASP.Net MVC pattern concerns on separating the content from presentation and data-processing from content. |
|
| 69. |
Explain the advantages of ASP.Net MVC over ASP.NET? |
|
Answer»
|
|
| 70. |
How does the 'page lifecycle' of ASP.Net MVC works? |
|
Answer» Below are the processed followed in the sequence -
|
|
| 71. |
Do you know about the new features in ASP.Net MVC 4 (ASP.Net MVC4)? |
|
Answer» Following are features added newly :Mobile templatesAdded ASP.NET Web API template for creating REST based services.Asynchronous controller task support.Bundling of the java scripts.Segregating the configs for ASP.Net MVC routing, Web API, Bundle etc. |
|
| 72. |
Tell us something about Model, view and Controllers in Asp.Net MVC? |
|
Answer» Model : It is basically a business entity which is used to represent the application data.Controller : The Request which is sent by the user always scatters through controller and it's responsibility is to redirect to the specific view using View () method.View : it's the presentation layer of ASP.Net MVC. |
|
| 73. |
Breifly explain us what is ASP.Net MVC? |
|
Answer» ASP.Net MVC is a pattern which is used to split the application's implementation logic into three components i.e. models, views, and controllers. |
|