<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Ajax with ASP.NET MVC Framework Preview 2</title>
	<atom:link href="http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/</link>
	<description>web development, tech reviews, tips, tricks, blogging</description>
	<lastBuildDate>Tue, 15 Jun 2010 18:48:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Emad Ibrahim</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-239</link>
		<dc:creator>Emad Ibrahim</dc:creator>
		<pubDate>Tue, 27 May 2008 13:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-239</guid>
		<description>@Pieter: thanks for sharing your findings
@Christian: I am not sure what is going on here.  I personally never used ContainsDataItem method on ViewData because I always used a typed ViewData.

I have a BaseViewData that is used on the master page and every page using that master and then I create derived classes for ViewData for each page e.g. UserInfoViewData, etc...</description>
		<content:encoded><![CDATA[<p>@Pieter: thanks for sharing your findings<br />
@Christian: I am not sure what is going on here.  I personally never used ContainsDataItem method on ViewData because I always used a typed ViewData.</p>
<p>I have a BaseViewData that is used on the master page and every page using that master and then I create derived classes for ViewData for each page e.g. UserInfoViewData, etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schiffer</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-237</link>
		<dc:creator>Christian Schiffer</dc:creator>
		<pubDate>Tue, 27 May 2008 11:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-237</guid>
		<description>Thanks for the update, also thank to Pieter, but I still have problems with the RenderPartialCore method, like Pieter says when calling the RenderPartial method on a UserControl it becomes a recursive call and we get an overflow exception, after having chnged the methos to Pieters version that doesent happen anymore, however somehow my Viewdata get corrupted so that even though it looks the same when examining it in debud I cannot access the data i the ViewData. eg. calling the ViewData.ContainsDataItem(MyKey) returns false even though examing the object clearly show the existence of the Key and Data.

Any thoughts? Updates? I am using preview 2 the interim release. Please answer quickly I am so stuck...</description>
		<content:encoded><![CDATA[<p>Thanks for the update, also thank to Pieter, but I still have problems with the RenderPartialCore method, like Pieter says when calling the RenderPartial method on a UserControl it becomes a recursive call and we get an overflow exception, after having chnged the methos to Pieters version that doesent happen anymore, however somehow my Viewdata get corrupted so that even though it looks the same when examining it in debud I cannot access the data i the ViewData. eg. calling the ViewData.ContainsDataItem(MyKey) returns false even though examing the object clearly show the existence of the Key and Data.</p>
<p>Any thoughts? Updates? I am using preview 2 the interim release. Please answer quickly I am so stuck&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emad Ibrahim</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-462</link>
		<dc:creator>Emad Ibrahim</dc:creator>
		<pubDate>Tue, 27 May 2008 11:13:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-462</guid>
		<description>@Pieter: thanks for sharing your findings&lt;br&gt;@Christian: I am not sure what is going on here.  I personally never used ContainsDataItem method on ViewData because I always used a typed ViewData.&lt;br&gt;&lt;br&gt;I have a BaseViewData that is used on the master page and every page using that master and then I create derived classes for ViewData for each page e.g. UserInfoViewData, etc...</description>
		<content:encoded><![CDATA[<p>@Pieter: thanks for sharing your findings<br />@Christian: I am not sure what is going on here.  I personally never used ContainsDataItem method on ViewData because I always used a typed ViewData.</p>
<p>I have a BaseViewData that is used on the master page and every page using that master and then I create derived classes for ViewData for each page e.g. UserInfoViewData, etc&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Christian Schiffer</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-461</link>
		<dc:creator>Christian Schiffer</dc:creator>
		<pubDate>Tue, 27 May 2008 09:27:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-461</guid>
		<description>Thanks for the update, also thank to Pieter, but I still have problems with the RenderPartialCore method, like Pieter says when calling the RenderPartial method on a UserControl it becomes a recursive call and we get an overflow exception, after having chnged the methos to Pieters version that doesent happen anymore, however somehow my Viewdata get corrupted so that even though it looks the same when examining it in debud I cannot access the data i the ViewData. eg. calling the ViewData.ContainsDataItem(MyKey) returns false even though examing the object clearly show the existence of the Key and Data.&lt;br&gt;&lt;br&gt;Any thoughts? Updates? I am using preview 2 the interim release. Please answer quickly I am so stuck...</description>
		<content:encoded><![CDATA[<p>Thanks for the update, also thank to Pieter, but I still have problems with the RenderPartialCore method, like Pieter says when calling the RenderPartial method on a UserControl it becomes a recursive call and we get an overflow exception, after having chnged the methos to Pieters version that doesent happen anymore, however somehow my Viewdata get corrupted so that even though it looks the same when examining it in debud I cannot access the data i the ViewData. eg. calling the ViewData.ContainsDataItem(MyKey) returns false even though examing the object clearly show the existence of the Key and Data.</p>
<p>Any thoughts? Updates? I am using preview 2 the interim release. Please answer quickly I am so stuck&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pieter</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-220</link>
		<dc:creator>Pieter</dc:creator>
		<pubDate>Tue, 13 May 2008 20:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-220</guid>
		<description>Thanks for the patch. Just noticed something a bit strange. In the AjaxViewExtensions class your change results in a recursive call to the calling View (if that makes sense).

Thus if you try the following (List.aspx):
&lt;code&gt;
this.RenderPartial(&quot;UserList&quot;, ViewData.Users);    
&lt;/code&gt;

where UserList is a UserControl (ascx), the RenderPartial calls List.aspx again.

To fix this I changed the RenderPartialCore method to:
&lt;code&gt;
        private static void RenderPartialCore(ViewContext viewContext, string viewName, object viewData)
        {
            if (String.IsNullOrEmpty(viewName))
                throw new ArgumentNullException(viewName);

            // TODO: Need to be able to get the view engine associated with this controller
            //       without the cast to the specific implementation
            Controller controller = (Controller)viewContext.Controller;

            // create a new view context for the view called, not the existing view
            ViewContext newContext = new ViewContext(controller.ControllerContext, viewName, null, viewData, controller.TempData);

            //emad ibrahim: controller has a viewengine already
            controller.ViewEngine.RenderView(newContext);
            //IViewFactory viewFactory = controller.ViewFactory;
            //IView partialView = viewFactory.CreateView(viewContext, viewName, null, viewData);
            //partialView.RenderView(viewContext);
        }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for the patch. Just noticed something a bit strange. In the AjaxViewExtensions class your change results in a recursive call to the calling View (if that makes sense).</p>
<p>Thus if you try the following (List.aspx):<br />
<code><br />
this.RenderPartial("UserList", ViewData.Users);<br />
</code></p>
<p>where UserList is a UserControl (ascx), the RenderPartial calls List.aspx again.</p>
<p>To fix this I changed the RenderPartialCore method to:<br />
<code><br />
        private static void RenderPartialCore(ViewContext viewContext, string viewName, object viewData)<br />
        {<br />
            if (String.IsNullOrEmpty(viewName))<br />
                throw new ArgumentNullException(viewName);</p>
<p>            // TODO: Need to be able to get the view engine associated with this controller<br />
            //       without the cast to the specific implementation<br />
            Controller controller = (Controller)viewContext.Controller;</p>
<p>            // create a new view context for the view called, not the existing view<br />
            ViewContext newContext = new ViewContext(controller.ControllerContext, viewName, null, viewData, controller.TempData);</p>
<p>            //emad ibrahim: controller has a viewengine already<br />
            controller.ViewEngine.RenderView(newContext);<br />
            //IViewFactory viewFactory = controller.ViewFactory;<br />
            //IView partialView = viewFactory.CreateView(viewContext, viewName, null, viewData);<br />
            //partialView.RenderView(viewContext);<br />
        }<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pieter</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-460</link>
		<dc:creator>Pieter</dc:creator>
		<pubDate>Tue, 13 May 2008 18:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-460</guid>
		<description>Thanks for the patch. Just noticed something a bit strange. In the AjaxViewExtensions class your change results in a recursive call to the calling View (if that makes sense).&lt;br&gt;&lt;br&gt;Thus if you try the following (List.aspx):&lt;br&gt;&lt;code&gt;&lt;br&gt;this.RenderPartial(&quot;UserList&quot;, ViewData.Users);    &lt;br&gt;&lt;/code&gt;&lt;br&gt;&lt;br&gt;where UserList is a UserControl (ascx), the RenderPartial calls List.aspx again.&lt;br&gt;&lt;br&gt;To fix this I changed the RenderPartialCore method to:&lt;br&gt;&lt;code&gt;&lt;br&gt;        private static void RenderPartialCore(ViewContext viewContext, string viewName, object viewData)&lt;br&gt;        {&lt;br&gt;            if (String.IsNullOrEmpty(viewName))&lt;br&gt;                throw new ArgumentNullException(viewName);&lt;br&gt;&lt;br&gt;            // TODO: Need to be able to get the view engine associated with this controller&lt;br&gt;            //       without the cast to the specific implementation&lt;br&gt;            Controller controller = (Controller)viewContext.Controller;&lt;br&gt;&lt;br&gt;            // create a new view context for the view called, not the existing view&lt;br&gt;            ViewContext newContext = new ViewContext(controller.ControllerContext, viewName, null, viewData, controller.TempData);&lt;br&gt;&lt;br&gt;            //emad ibrahim: controller has a viewengine already&lt;br&gt;            controller.ViewEngine.RenderView(newContext);&lt;br&gt;            //IViewFactory viewFactory = controller.ViewFactory;&lt;br&gt;            //IView partialView = viewFactory.CreateView(viewContext, viewName, null, viewData);&lt;br&gt;            //partialView.RenderView(viewContext);&lt;br&gt;        }&lt;br&gt;&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Thanks for the patch. Just noticed something a bit strange. In the AjaxViewExtensions class your change results in a recursive call to the calling View (if that makes sense).</p>
<p>Thus if you try the following (List.aspx):<br /><code><br />this.RenderPartial("UserList", ViewData.Users);    <br /></code></p>
<p>where UserList is a UserControl (ascx), the RenderPartial calls List.aspx again.</p>
<p>To fix this I changed the RenderPartialCore method to:<br /><code><br />        private static void RenderPartialCore(ViewContext viewContext, string viewName, object viewData)<br />        {<br />            if (String.IsNullOrEmpty(viewName))<br />                throw new ArgumentNullException(viewName);</p>
<p>            // TODO: Need to be able to get the view engine associated with this controller<br />            //       without the cast to the specific implementation<br />            Controller controller = (Controller)viewContext.Controller;</p>
<p>            // create a new view context for the view called, not the existing view<br />            ViewContext newContext = new ViewContext(controller.ControllerContext, viewName, null, viewData, controller.TempData);</p>
<p>            //emad ibrahim: controller has a viewengine already<br />            controller.ViewEngine.RenderView(newContext);<br />            //IViewFactory viewFactory = controller.ViewFactory;<br />            //IView partialView = viewFactory.CreateView(viewContext, viewName, null, viewData);<br />            //partialView.RenderView(viewContext);<br />        }<br /></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-160</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Mon, 07 Apr 2008 13:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-160</guid>
		<description>Thank you so very much.</description>
		<content:encoded><![CDATA[<p>Thank you so very much.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Henry</title>
		<link>http://www.emadibrahim.com/2008/03/31/ajax-with-aspnet-mvc-framework-preview-2/comment-page-1/#comment-459</link>
		<dc:creator>Henry</dc:creator>
		<pubDate>Mon, 07 Apr 2008 11:52:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.emadibrahim.com/?p=379#comment-459</guid>
		<description>Thank you so very much.</description>
		<content:encoded><![CDATA[<p>Thank you so very much.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->