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. 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
2. .aspx

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?
Ans:- @Html.TextBox("Name")

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?
Ans:-
@* 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?
Ans:- http://www.interviewquestionspdf.com/2014/09/razor-view-vs-aspx-view-engine.html

Comments

  1. KiaOra,

    Muchas Gracias Mi Amigo! You make learning so effortless. Anyone can follow you and I would not mind following you to the moon coz I know you are like my north star.


    I am preparing a chart using XlsIO and I would like to set data labels as values from cells. Is it possible to do that? I am afraid that the IChartDataLabels interface does not provide such option. ASP .Net .

    Anyways great write up, your efforts are much appreciated.

    Regards,
    Kevin

    ReplyDelete

Contact Form

Send