Pages

Saturday, October 4, 2014

ASP.NET MVC Question and Answer Part-2

Here are few ASP.NET MVC interview question and answer which are very useful to clear eLance test.

1- Which attribute could you use if you had a property on your Model class that you wish to be hidden when using the EditorForModel HTML Helper method?

A- DisplayValue
B- Display
C- Hidden
D- HiddenInput

Answer-D

2-The advantage of using read-only attribute for session state is:

A- Scalability
B- Neither of these
C- Parallel access of session
D- Both of these

Answer-C

3-What type of filter should be used if you want to modify the result of an action method?

A- Action filter
B- Output filter
C- Result filter
D- Response filter

Answer-C

4- An MVC application can have a:

A- Both session and view state
B- Session
C- View state
D- Neither session nor view state

Answer-B

5- Which property can you set on the BundleCollection class to indicate that you wish to enable support for CDN scripts or styles?

A- Cdn
B- UseCdnServer
C- CdnEnabled
D- UseCdn

Answer-D

6-You are authoring unit tests. The unit tests must test code that consumes sealed classes. You need to create,maintain, and inject dependencies in the unit tests.

A- T4 text templates and code generation
B- Stub types
C- Shim types
D- Hard-coded implementation

Answer - C

7- Which class is used by the MVC pipeline to map data from a HTTP request to the parameters in a controller's action method?

A- DefaultModelBinder
B- ModelBinder
C- ParameterBinder
D- RouteBinder

Answer- A

8- Which class contains information about the HTTP request that is parsed and inspected by the MVC pipeline when determining which controller and action to invoke?

A- Request
B- RequestContext
C- HttpRequestObject
D- HttpContext

Answer- B

9- What is the most scalable way to share Session information in a web farm?

A- InProc storage
B- AppFabric caching
C- SQL Server storage
D- ASP.net State Server

Answer-B

10- What type would your Controller's action return if you wish to have an asynchronous action method that returns a View?

A- Task
B- AsyncActionResult
C- Task
D- ActionResult

Answer - C

11- You are developing an ASP.NET MVC application. The application must allow users to enter JavaScript in a feedback text box only. You need to disable request validation. What should you do?

A- Apply and set the CausesClientSideValidation attribute on the text box to FALSE.
B- Apply and set the ValidateInput attribute on the text box to FALSE.
C- Use the HttpRequest.Unvalidated property to read the unvalidated form value.
D- Use the HttpRequest.Form property to read the unvalidated form value.

Answer- C

12- ASP.NET MVC Framework implements a(n):

A- Front controller pattern
B- Page controller pattern
D- MVC pattern

Answer- A

No comments:

Shared Button