Render view as string when Ajax request to view is made
- by mare
I have my views render to route requests like /controller/action (for instance, /Page/Create), so pretty classic.
I am creating a form where view will be loaded through AJAX request with jQuery get(), so essentially I need my Views or to be precise, my controller actions, to return plain HTML string when an AJAX request is made to the route that renders the View. I want to use the same views as for normal requests, so I cannot afford to create any new views.
It is something like calling RenderPartial("MyViewUserControl") but from inside the JS code.