TOP 10 RAZOR VIEW ENGINE INTERVIEW QUESTIONS AND ANSWERS
TOP 10 RAZOR VIEW ENGINE INTERVIEW QUESTIONS AND ANSWERS BEST RAZOR VIEW ENGINE INTERVIEW QUESTIONS BOTH FOR BEGINNER AND EXPERIENCED 1....
BEST RAZOR VIEW ENGINE INTERVIEW QUESTIONS BOTH FOR BEGINNER AND EXPERIENCED
1. What is a View Engine?
Ans:- View Engines are responsible for rendering the HTML from your views to the browser. The view engine template will have different syntax for implementation.
2. What is Razor view engine?
Ans:- The Razor view engine is an advanced view engine from Microsoft, It is launched with MVC 3 (in VS 4.0). Razor using an @ character instead classic ASP.NET(.aspx) <% %>
and Razor does not require you to explicitly close the code-block, this view engine is parsed intelligently by the run-time to determine what is a presentation element and what is a code element.
3. What are the two popular asp.net mvc view engines?
Ans:- 1. Razor
4. What are the file extension for Razore view engine files?
Ans:- Razor syntax have the special file extension cshtml (Razor with C#) and vbhtml (Razor with VB).
5. Can you give a simple example of textbox?
6. What HTML code will be produce by "@Html.TextBox("Name")"?
Ans:- It will produce:-
<input id="Name" name="Name" type="textbox" />
7. What is the difference between @Html.TextBox and @Html.TextBoxFor?
Ans:- Finaly both produce the same HTML but Html.TextBoxFor() is strongly typed with any model, where as Html.TextBox isn't.
For more click here http://www.interviewquestionspdf.com/2014/09/difference-between-htmltextbox-and.html
8. TextBoxFor input extension is first time introduce in which MVC version?
Ans:- In MVC2
9. What is the syntax for server side comment in razor view?
@* here is the code to comment *@
10. How to add Namespaces in Razor view engine?
Ans:- @using YourCustomNamespace
What is the difference between RAZOR VIEW and ASPX VIEW ENGINE?