Does anyone have an alternative to string builder when creating the html mark-up in an UmbracoApiController to pass back to a view via an Ajax call?
At the moment I'm passing back blog post previews which is 7-10 lines of mark-up. It seems like a clunky way of doing it building it in string builder.
String Builder - UmbracoApiController Ajax
Hello,
Does anyone have an alternative to string builder when creating the html mark-up in an UmbracoApiController to pass back to a view via an Ajax call?
At the moment I'm passing back blog post previews which is 7-10 lines of mark-up. It seems like a clunky way of doing it building it in string builder.
Thanks and kind regards,
James.
Hi James,
You can use this approach for rendering view to string and then return it for ajax request.
http://stackoverflow.com/questions/9243433/how-to-render-a-razor-view-to-a-string-in-asp-net-mvc-3
And maybe it will be better to fill html markup on client side ? Get data from server in json and fill html template with this data.
Thanks, Alex
is working on a reply...