Comments for Crafty Code https://craftycode.wordpress.com Handy coding solutions and philosophical ramblings Tue, 02 Dec 2014 04:07:27 +0000 hourly 1 http://wordpress.com/ Comment on ASP.NET MVC Render Partial View to String by craftycode https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-266 Tue, 07 Oct 2014 16:22:01 +0000 http://craftycode.wordpress.com/?p=54#comment-266 In reply to Arnel Ambrosio.

I have not worked with MVC 4 yet, but I assume my solution is probably outdated by now. It has been several years, after all. 🙂

]]>
Comment on ASP.NET MVC Render Partial View to String by ASP.NET MVC: Using Ajax, Json and PartialViews | sharvanblog https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-262 Mon, 22 Sep 2014 15:24:54 +0000 http://craftycode.wordpress.com/?p=54#comment-262 […] important thing here is the method “RenderPartialViewToString”. I ran across this which was a tremendous resource in solving my problem here, which was returning a Json Object with […]

]]>
Comment on ASP.NET MVC Render Partial View to String by Sanjay https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-227 Wed, 26 Jun 2013 17:06:03 +0000 http://craftycode.wordpress.com/?p=54#comment-227 Great Post….Thanks a ton.

]]>
Comment on ASP.NET MVC Render Partial View to String by b.b. https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-222 Thu, 16 May 2013 16:29:04 +0000 http://craftycode.wordpress.com/?p=54#comment-222 In reply to anyeone.

This is what I actually came here for too. As far as I can see this shortcoming is due to classical Asp.Net on top of which Mvc resides. Despite a lot of horse-trading* there has been no solution to the problem yet.

*precompiled view, custom view engine, in-memory-view-rendering, headless browser, hosting Asp.Net app from disk location, layers and layers of indirection, etc.

]]>
Comment on ASP.NET MVC Render Partial View to String by b.b. https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-221 Thu, 16 May 2013 16:11:10 +0000 http://craftycode.wordpress.com/?p=54#comment-221 In reply to Jim Maguire.

I do not see how MvcHtmlString-ifying should remove any tabs or line breaks. In fact, it does not. MvcHtmlString does not modify the wrapped string at all. To get rid of the above mentioned items you could use something like TidyNet or TidyManaged. Though, this is pretty much a side-effect. BTW, why would you want to do this?

]]>
Comment on Rownum Simulation with MySQL by Joe Bluemax https://craftycode.wordpress.com/2010/09/13/rownum-simulation-with-mysql/#comment-220 Mon, 13 May 2013 13:10:09 +0000 http://craftycodeblog.com/?p=186#comment-220 Great work!! Really appreciate it.

]]>
Comment on ASP.NET MVC Render Partial View to String by rrn https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-218 Wed, 27 Mar 2013 11:47:28 +0000 http://craftycode.wordpress.com/?p=54#comment-218 Now the better solution is use ASP.NET Razor view engine.

]]>
Comment on ASP.NET MVC Render Partial View to String by Mohamed Asane https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-217 Tue, 19 Mar 2013 08:35:25 +0000 http://craftycode.wordpress.com/?p=54#comment-217 Superb work.

I’m getting an error when executing this line:

viewResult.View.Render(viewContext, sw);

“Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property”

This problem only occured when trying to convert large data such as 10k rows and above.

Thank you.

]]>
Comment on ASP.NET MVC Render Partial View to String by Arnel Ambrosio https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-render-partial-view-to-string/#comment-216 Thu, 21 Feb 2013 13:24:33 +0000 http://craftycode.wordpress.com/?p=54#comment-216 Hi Crafty, I tried to implement your code in MVC 4, but I generated an error to this:
ViewEngineResult viewResult = ViewEngines.Engines.FindView(ControllerContext, viewName, “”); This error says: Value cannot be null.
Parameter name: controllerContext. Please help, Thanks a lot.

]]>
Comment on ASP.NET MVC Ajax Redirect by B- https://craftycode.wordpress.com/2010/05/15/asp-net-mvc-ajax-redirect/#comment-215 Sun, 17 Feb 2013 17:55:20 +0000 http://craftycode.wordpress.com/?p=86#comment-215 In reply to Stephen Potter.

This helped my situation more effectively as my page wasn’t relaoding after the redirect when using Ajax.Begin form.

]]>