<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Codepolice.net &#187; stackoverflow</title>
	<atom:link href="http://codepolice.net/tag/stackoverflow/feed/" rel="self" type="application/rss+xml" />
	<link>http://codepolice.net</link>
	<description>C#, ASP.NET, MVC, LINQ, Wordpress and stuff like that</description>
	<lastBuildDate>Mon, 26 Jul 2010 08:58:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>StackoverflowException with ASP.NET MVC</title>
		<link>http://codepolice.net/2008/12/04/stackoverflowexception-aspnet-mvc/</link>
		<comments>http://codepolice.net/2008/12/04/stackoverflowexception-aspnet-mvc/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 11:57:57 +0000</pubDate>
		<dc:creator>Ola</dc:creator>
				<category><![CDATA[MVC]]></category>
		<category><![CDATA[asp.net mvc]]></category>
		<category><![CDATA[modelbinders]]></category>
		<category><![CDATA[stack overflow]]></category>
		<category><![CDATA[stackoverflow]]></category>
		<category><![CDATA[stackoverflowexception]]></category>

		<guid isPermaLink="false">http://www.codepolice.net/?p=78</guid>
		<description><![CDATA[I got this strange Stackoverflow exeption today in my MVC project. I have made some modifications to my data model and all of a sudden i got a stackoverflowexception when i was submitting data via a form. I started googling about it and found this thread on the asp.net message board. It turns out that [...]]]></description>
			<content:encoded><![CDATA[<p>I got this strange Stackoverflow exeption today in my MVC project. I have made some modifications to my data model and all of a sudden i got a stackoverflowexception when i was submitting data via a form.</p>
<p>I started googling about it and found this <a href="http://forums.asp.net/t/1335683.aspx">thread on the asp.net message board.</a> It turns out that the Default modelbinder was causing this. The modelbinder is basically what makes ASP.NET MVC able to automatically bind form post values to your object. You probably know it in some degree if you reading this.</p>
<p>Anyway, to solve the problem you should declare what fields you want to include in the binding by adding an attribute like this. This way the modelbinder wont have to deal with the properties that you do not handle in some way.</p>
<div class="codecolorer-container csharp twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> ActionResult Ask<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#91;</span>Bind<span style="color: #008000;">&#40;</span>Prefix<span style="color: #008000;">=</span><span style="color: #666666;">&quot;question&quot;</span>,Include<span style="color: #008000;">=</span><span style="color: #666666;">&quot;Text,Title&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>Question question<span style="color: #008000;">&#41;</span></div></div>
<p>According to the post in the forums this is a bug that will be fixed in the next release of the MVC framework. Now back to work!</p>
<p>Read more about both model binders and the bind attribute at <a href="http://weblogs.asp.net/scottgu/archive/2008/10/16/asp-net-mvc-beta-released.aspx">Scott Guthries blog post about the beta</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://codepolice.net/2008/12/04/stackoverflowexception-aspnet-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</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! -->