1. To prevent public controller from being implicitly bound to action name which attribute we used?
Ans: To prevent public controller from being implicitly bound to action name we use NonAction attribute like below:
[NonAction]
public ActionResult ContactUs()
{
}
2. A class has field with value initialized and this value has also been set into constructor. Which value is set first, initialized value or constructor value?
Ans: Initialized
3. How to get the default value of the C# variables?
Ans: default keyword can be used
4. What is main objective of ASP.NET MVC 4 or What is new in MVC4 ?
Ans:
Ans: To prevent public controller from being implicitly bound to action name we use NonAction attribute like below:
[NonAction]
public ActionResult ContactUs()
{
}
2. A class has field with value initialized and this value has also been set into constructor. Which value is set first, initialized value or constructor value?
Ans: Initialized
3. How to get the default value of the C# variables?
Ans: default keyword can be used
4. What is main objective of ASP.NET MVC 4 or What is new in MVC4 ?
Ans:
- Easy Mobile web applications (ASP.NET MVC 4 complete focus on Mobile application development)
- Full HTML5 support
- ASP.NET MVC web application with cloud support
- Working with different mobile and desktop web browsers
5. What is Web API's in Asp.Net MVC 4 ?
Ans:
- Web API is a new framework for consuming & building HTTP Services.
- Web API supports wide range of clients including different browsers and mobile devices.
- It is very good platform for developing RESTful services since it talk’s about HTTP.
6. What are the new enhancements done in default project template of ASP.NET MVC 4?
Ans: 1. Adaptive rendering for nice look and feel
2. Modern looking for Mobile and Desktop browser
7. Why we need a separate mobile project template, while we can render our web application in mobile (What’s new in MVC 4 Mobile template) ?
Ans: Smart Phones & tablets touch got smart by using new jQuery.Mobile.MVC NuGet pacage.
8. What are the main features of ASP.NET MVC 4 used by ASP.NET Web API?
Ans: Routing Changes: ASP.NET Web API uses same convention for config mapping that ASP.NET MVC provides.
Model Binding and Validations: ASP.NET Web API uses same model binding functionality, but HTTP specific context related operations only.
Filters: The ASP.NET Web API uses most of built-in filters from MVC
Unit Testing: Now Unit testing based on MVC, strongly unit testable.
9. Which assembly is used to define the MVC Framework and why?
Ans: The MVC Framework is defined through System.Web.MVC assembly. This is because this is the only assembly which contains classes and interfaces that support the asp.net Model View Controller framework for creating web application.
10. What are anonymous types?
Ans: Anonymous types are Data types that are declared by the compiler, rather than through the explicit class definition.
example: var n= {number=10, message="hi"};
Console.WriteLine(n.number+n.message);
No comments:
Post a Comment