MVC + Forms: error message

I am getting the following error when I try to do a simple form post on my MVC website.

Accessing a BinaryRead, Form, Files, or InputStream before internal memory was full of the caller's HttpRequest.GetBufferedInputStream.

Description: An unhandled exception was thrown during the execution of the current web request. Review the stack trace for more information about the error and how it occurs in your code.

Exception Details: System.InvalidOperationException: A BinaryRead, Form, Files, or InputStream was accessed before internal memory was full of the caller HttpRequest.GetBufferedInputStream.

enter image description here

My sample form and actions are pretty simple ...

@using (Html.BeginForm("Create", "Form"))
{
    <div class="row action">
        <div class="row">
            First name: <input type="text" name="fname"><br>
            Last name: <input type="text" name="lname"><br>
        </div>
        <input type="submit" id="save" class="btn" value="Save"/>
        <input type="button" id="cancel" class="btn" value="Cancel"/>
     </div>
}

      

And my controller action is even more basic ...

[HttpPost]
    public ActionResult Create(FormCollection collection)
    {
        try
        {
            // TODO: Add insert logic here

            return RedirectToAction("Index");
        }
        catch
        {
            return View();
        }
    }

      

+3


source to share


1 answer


Please share a route.config file that can help resolve this issue. Just in case, also try removing the perimeters from Html.BeginForm () to remove the action and controller name. Since MVC has strong naming systems, we don't need to add this information.



if the above doesn't solve your problem. Share the route file.

0


source







All Articles