Is it possible to render a view from a class, which is not controller?
For example, I’m having a class which will return some data, like controls, which i want to derive from my view.
Is it possible?
Thanks in advance.
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 a view, we have a method named Html.Partial which renders a partial to a string. Within your controller, you can instantiate an HtmlHelper instance and then call the Partial extension method on it. Make sure you import the System.Web.Mvc.Html namespace in your controller.