how does visual studio determine which is a view vs a partial view? Another question would be; is there a way to convert my views into partial views?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Razor there is no distinction between views and partial views as there is in WebForms (.aspx vs .ascx). In Razor all views are templates. Those templates could have a Layout:
In this case they are views. If there is no layout specified they could be considered as partial views. The Layout is usually defined in the
~/Views/_ViewStart.cshtmlfile.This being said if from your controller action you
return PartialView();instead ofreturn View();this layout will not be applied.I would recommend you reading the following blog post about Razor views and layouts.