Thursday, November 22, 2012

C# and ASP.NET MVC (Model view controller) interview questions and answers:- What are MVC partial views and how can we call the same in MVC pages?

ASP.NET MVC (Model view controller) partial view is a reusable view (like a user control)which can be embedded inside other view. For example let's say all your pages of your site have a standard structure with left menu,header and footer as shown in the image below.



For every page you would like to reuse the left menu, header and footer controls.So you can go and create partial views for each of these items and then you call that partial view in  the  main view.

When you add a view to your project you need to check the “Create partial view” check box.



Once the partial view is created you can then call the partial view in the main view using "Html.RenderPartial" method as shown in the below code snippet'










Below is an important SQL server interview question and answers video:-




Do visit us for c#  and ASP.NET MVC interview question and answers

See more stuffs on C#/ASP.NET interview questions 

Regards,

Click here to see more C# and ASP.NET interview questions and answers

No comments: