Thursday, October 9, 2014

ASP.NET MVC Question and Answer Part-3

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

1-How do you prevent routing?

A- Use ignoreroute method
B- Use authentication flag in web.config
C- Use deleteroute method

Answer-A

2-You are developing an ASP.NET MVC application that displays stock market information. The stock market information updates frequently and must be displayed in real-time. You need to eliminate unnecessary header data, minimize latency, and transmit data over a full-duplex connection. What should you do?

A- Implement WebSockets protocol on the client and the server.
B- Implement long-running HTTP requests.
C- Configure polling from the browser.
D- instantiate a MessageChannel object on the client.

Answer-A

3- You are developing an ASP.NET MVC application. You need to authenticate clients by using NT LAN Manager (NTLM). Which authentication method should you implement?

1- Basic
2- Forms
3- Windows
4- Kerberos

Answer-C

4- The UIHint attribute is used to do what?

A- Used on the Mode to specify the Title attribute for a generated html control.
B- Used on the Controller to specify custom routes.
C- Placed on the Controller to specify which view to load.
D- Used on the Model to describe style attributes to change things like color and size.
E- Placed on the Model to specify the custom template to render for the property.

Answer-E

5- Which is true about ModelState?

A- It has the state of the model
B- It has the model properties and filters
C- It has the properties that have changed only

Answer-A

6- How is a model passed to a controller action validated?

A- StateModel.IsValid
B- State.IsValid
C- ModelState.IsValid
D- odel.IsValid
E- StateManager.IsValid

Answer-C

7- If you wish to include custom transformation logic in your Bundles, which interface could you implement?

A- Itransform
B- Ibundle
C- IBundleInvoker
D- IBundleTransform

Answer-D

8-If you wanted to use a partial view but also pass the same model object from the parent view, what HTML Helper would you use?

A- Html.Partial()
B- Html.Action()
C- Html.PartialWithModel()
D- Html.ActionWithModel()

Answer-A

9- Which namespace contains the attributes used to describe your model and it's properties?

A- System.ComponentModel.DataAnnotations
B- System.Annotations
C- System.Web.Mvc
D- System.Web

Answer-A

10- Which of the following protocols are not supported by WCF?

A- NAMED PIPES FOR ON MACHINE COMMUNICATIONS
B- HTTP
C- PEER TO PEER PROTOCOLS
D- All of these choices are supported by WCF
E- TCP /IP

Answer-D

11- Where is data validation done?

A- Controller
B- Model
C- View

Answer-B

12- If you have a _Layout.cshtml file in your shared views, which file can you create to have  custom layout for mobile platforms?

A- _Layout.device.cshtml
B- _Layout.mob.cshtml
C- _Layout.mobile.cshtml
D- _Layout_mobile.cshtml

Answer-C

13- What property could you set on the OutputCache attribute to indicate that you want it to instantiate new caches for different combinations of parameters to the Controller action method?

A- VaryByParam
B- VaryByAction
C- VaryByBinding
D- VaryByCustom

Answer-A

14- What attribute is used to handle an exception that is thrown by an action method?

A- IgnoreExceptionAttribute
B- IgnoreErrorAttribute
C- HandleErrorAttribute
D- CatchErrorAttribute
E- ValidateExceptionAttribute

Answer-C

No comments:

Shared Button