Dot Net Interview Questions and Answers Part 23

1. Tell me mvc view engines?
Ans:- 1. Razor
         2. .aspx

2. Tell me the file extensions for Razore view engine files in and
Ans:- Razor syntax have the different file extension for both (.cshtml) and (.vbhtml)

3. How we use textbox in mvc?
Ans:- @Html.TextBox("FieldName")

4. What is the internal interpretation for "@Html.TextBox("Name")"?
Ans:- Generates : <input id="Name" name="Name" type="textbox" />

5. Differences between @Html.TextBox and @Html.TextBoxFor
Ans:- Html.TextBoxFor() is strongly typed with any model
      Html.TextBox isn't strongly typed

6. In which version of mvc the TextBoxFor input extension is first time introduced?
Ans:- MVC2

7. How server side comment are declared in razor view?
Ans:@* server side code to comment *@

8. How to add Namespaces in Razor view engine?
Ans:- @using NamespaceHere

9. How to add models in Razor view engine?
Ans:- @model projectname.models.modelname

10. How to add list of models in Razor view engine?
Ans:- @model IEnumerable<projectname.models.modelname>


Receive Quality Tutorials Straight in your Inbox by submitting your Email below:

Delivered by FeedBurner

Protected by Copyscape Duplicate Content Checker