Skip to content

Codepolice

  • ⤫

StackoverflowException with ASP.NET MVC

Posted by Judy Alvarez Posted on February 25, 2022March 1, 2022
0

I got this strange Stackoverflow exception today in my MVC project. I have made some modifications to my data model and all of a sudden I got a stack overflow exception 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 the Default model binder was causing this. The model binder is basically what makes ASP.NET MVC able to automatically bind form post values to your object. You probably know it to some degree if you reading this.

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 model binder won’t have to deal with the properties that you do not handle in some way.

public ActionResult Ask([Bind(Prefix="question",Include="Text,Title")]Question question)

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!

Read more about both model binders and the bind attribute at Scott Guthries blog post about the beta.

Categories: JavascriptTagged: asp net angular, asp net api, asp net application, asp net core 3.1, asp net core api, asp net core blazor, asp net core dependency injection, asp net core docker, asp net core environment variables, asp net core vs asp net, asp net core web application, asp net development company, asp net frameworks, asp net login, asp net mvc 4, asp net signalr, asp net tutorial c#, asp net tutorial for beginners, asp net versions, asp net web hosting, asp net webform, authentication asp net, data binding in asp net, download asp net, microservices asp net core, middleware in asp net core, radio button in asp net, required field validator in asp net, smarter asp net, windows authentication in asp net

Post navigation

Previous Previous post: Generate expiring urls for Amazon S3 via a WordPress Plugin
Next Next post: Remote Desktop Connection (RDP) becomes extremely slow after installing “Intel Smart Connect Technology” update

Related Posts

  • Bringing Python apps into Node

    #​596 — October 14, 2025 Read on the Web 📂 A Modern Guide to Reading and Writing Files in Node — A comprehensive guide to various methods for working with files, from promise-based methods through to working with streams, processing files concurrently, using file handles, and memory-efficient techniques. Luciano Mammino A Way to Integrate Python ASGI with Node.js

    Posted by Posted on October 14, 2025
    0
  • Vite gets its own documentary

    #​756 — October 10, 2025 Read on the Web JavaScript Weekly ▶  Vite: The Documentary — From the same creators of the fantastic ▶️ Node.js, ▶️ Angular and ▶️ React documentaries comes an up to date look at Vite, the build tool that has taken the JavaScript ecosystem by storm in recent years. Many luminaries make an appearance to

    Posted by Posted on October 10, 2025
    0
  • npm security best practices to consider

    #​595 — October 7, 2025 Read on the Web 15 Recent Node Features That Can Replace Popular npm Packages — Many features that once required third-party packages are now built into the runtime itself. Here’s a look at some of the most notable that you may want to experiment with, prior to reducing unnecessary dependencies. Lizz

    Posted by Posted on October 7, 2025
    0
  • React 19.2 is in the building

    #​755 — October 3, 2025 Read on the Web JavaScript Weekly The State of JavaScript 2025 Survey — Each year, Devographics runs an epic survey of as many JavaScript community members as it can and turns the results into an interesting report on the state of the ecosystem – here’s the results from 2024. If

    Posted by Posted on October 3, 2025
    0
  • Using Node with Cloudflare Workers

    #​594 — September 30, 2025 Read on the Web 🗓️ We’re back after taking a week off for my birthday. I’ve never bothered to do that before, but I figured I’d give it a go, and.. it was good 😅 We’re now back every week until Christmas!__Peter Cooper, your editor A Year of Improving Node.js

    Posted by Posted on September 30, 2025
    0
  • The first browser with JavaScript landed 30 years ago

    #​754 — September 26, 2025 Read on the Web JavaScript Weekly Give Your AI Eyes: Introducing Chrome DevTools MCP — The Chrome team has released an MCP server for Chrome DevTools, enabling agents like Claude Code or OpenAI Codex to use the DevTools to debug and analyze the performance and behavior of your webapps (or

    Posted by Posted on September 26, 2025
    0
Judy Alvarez

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Codepolice

  • Github
  • Atlassian
  • Flatlogic
  • Xero
  • Jetbrains
  • Figma
  • Bringing Python apps into Node
  • Vite gets its own documentary
  • npm security best practices to consider
  • React 19.2 is in the building
  • Using Node with Cloudflare Workers
https://flatlogic.com/generator
COPYRIGHT © 2025 - Codepolice