Interviewer And Interviewee Guide

Fresh Model View Controller (MVC) Interview Questions & Answers:

1. What are sections?

Layout pages, can define sections, which can then be overriden by specific views making use of the layout. Defining and overriding sections is optional.

2. What are the file extensions for razor views?

1. .cshtml - If the programming lanugaue is C#
2. .vbhtml - If the programming lanugaue is VB

3. How do you specify comments using razor syntax?

Razor syntax makes use of @* to indicate the begining of a comment and *@ to indicate the end. An example is shown below.
@* This is a Comment *@

4. When using aspx view engine, to have a consistent look and feel, across all pages of the application, we can make use of asp.net master pages. What is asp.net master pages equivalent, when using razor views?

To have a consistent look and feel when using razor views, we can make use of layout pages. Layout pages, reside in the shared folder, and are named as _Layout.cshtml

5. When using razor views, do you have to take any special steps to proctect your asp.net mvc application from cross site scripting (XSS) attacks?

No, by default content emitted using a @ block is automatically HTML encoded to protect from cross site scripting (XSS) attacks.

6. In razor syntax, what is the escape sequence character for @ symbol?

The escape sequence character for @ symbol, is another @ symbol

Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.