ASP.NET MVC2 - 渲染视图,作为字符串 [英] ASP.NET MVC2 - Render a View as a String
问题描述
你如何渲染视图从控制器MVC 2字符串?
How do you render a view as a string from a controller in MVC 2?
在MVC 1中,我使用 CaptureActionHtml 。我与它有同样的问题类似的问题,但有没有办法做到这一点没有<一个href=\"http://stackoverflow.com/questions/32640/mocking-asp-net-mvc-controller-context\">Rhink.Mocks?
In MVC 1, I used CaptureActionHtml. I'm having the same problem with it as a similar question, but is there a way to do this without Rhink.Mocks?
推荐答案
我发现了一些从评论通过Bobasoft在的 http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/ 链接到<一个href=\"http://msug.vn.ua/blogs/bobasoft/archive/2010/01/07/render-partialview-to-string-asp-net-mvc.aspx\" rel=\"nofollow\">http://msug.vn.ua/blogs/bobasoft/archive/2010/01/07/render-partialview-to-string-asp-net-mvc.aspx.
I found something that works from a comment by Bobasoft at http://www.brightmix.com/blog/renderpartial-to-string-in-asp-net-mvc/ linking to http://msug.vn.ua/blogs/bobasoft/archive/2010/01/07/render-partialview-to-string-asp-net-mvc.aspx.
这篇关于ASP.NET MVC2 - 渲染视图,作为字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!