.Net Interview Questions and Answers

Search:

Explain the difference between layout and master pages ? (MVC Razor interview questions)

By : Shiv Prasad Koirala | Jun 20th, 2014 | Views : 8219 | Comments : 0 Bookmark and Share

Layout are like master pages in ASP.NET Web form. Master pages give a standard look and feel for Web form views while layout gives standard look and feel or acts like a template for razor views.


How to apply layout to Razor views?


So first we need to create a template file as shown in the below code.


<div>

@RenderSection("Header")

@RenderBody()

@RenderSection("Footer")

</div>


And then apply this template to the view as shown below and display data in those respective sections.


@Layout = "/Views/Default1/_LayoutPage1.cshtml";}

This is body

@section  FooterCopyright 2015-2016}

@section HeaderWelcome to my site}


You can go through these 100 MVC interview question with answers from

http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers


In case you are new to MVC you can start from the below MVC step by step video


 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi