Is it possible for a partial view to have a layout so that whenever the partial is rendered – it is rendered with its own layout ?
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.
Yes you can have a layout for a partial, just make sure your layout is not defining the header and the body sections of your html (because it’s for a partial).
here is a sample:
_partialViewLayout.cshtml
partialView.cshtml