MVC Developer Question:

Download Job Interview Questions and Answers PDF

Tell us what is ViewStart?

MVC Developer Interview Question
MVC Developer Interview Question

Answer:

Razor View Engine introduced a new layout named _ViewStart which is applied on all view automatically. Razor View Engine firstly executes the _ViewStart and then start rendering the other view and merges them.

Example of Viewstart:

@ {
Layout = "~/Views/Shared/_v1.cshtml";
} < !DOCTYPE html >
< html >
< head >
< meta name = "viewport"
content = "width=device-width" / >
< title > ViewStart < /title> < /head> < body >
< /body> < /html>

Download MVC Developer Interview Questions And Answers PDF

Previous QuestionNext Question
Tell me how can we do exception handling in MVC?Explain me what is the difference between ActionResult and ViewResult?