How can I create an individual controller and model for a partial view? I want to be able to place this partial view any where on the site so it needs it’s own controller. I am current rendering the partial as so
@Html.Partial("_Testimonials")
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.
Why not use
Html.RenderAction()?Then you could put the following into any controller (even creating a new controller for it):
Then you could create a new partial view and have your
PartialViewModelbe what it inherits from.For Razor, the code block in the view would look like this:
For the WebFormsViewEngine, it would look like this: