Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.Net MVC controller route when large records
    primarykey
    data
    text
    <p>In my application I have a page that displays a list of records and with every record there is a link to click for more details of that record. It goes to the other controller. Let me tell a sequence. From 'ToDoListSelect' controller it goes to 'ToDoList' and on clicking the link from ToDoList it goes to 'Info' controller. Everything works fine on my development machine with same database as on the server. Now, I put the package on server and there it works okay if the records on the page are less than 500 or so. If there are more records then from ToDoList it does not go to Info but throws exception and I see it's going to ToDoListSelect which is weird. I do not know where to start looking for the problem. Any suggestions? Any details needed just let me know. </p> <p>Here are the routes in my application:</p> <pre><code>public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults ); } protected void Application_Start() { AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); } </code></pre> <p>The error thrown is:</p> <p>Server Error in '/' Application. The operation is invalid because of the current state of the object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about this error, view and determine where the error originated in the code.</p> <p>Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object.</p> <p>Source Error:</p> <p>During execution of the current web request An unhandled exception was generated. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p> <pre><code>[InvalidOperationException: Der Vorgang ist aufgrund des aktuellen Zustands des Objekts ungültig.] System.Web.HttpRequest.FillInFormCollection() +11485999 System.Web.HttpRequest.get_Form() +157 Microsoft.Web.Infrastructure.DynamicValidationHelper.&lt;&gt;c__DisplayClass12.&lt;ReplaceCollection&gt;b__e() +63 Microsoft.Web.Infrastructure.DynamicValidationHelper.&lt;&gt;c__DisplayClass12.&lt;ReplaceCollection&gt;b__11() +20 Microsoft.Web.Infrastructure.DynamicValidationHelper.DeferredCountArrayList.get_Count() +20 System.Web.HttpRequest.ValidateNameValueCollection(NameValueCollection nvc, RequestValidationSource requestCollection) +34 System.Web.HttpRequest.get_Form() +212 System.Web.Mvc.FormValueProvider..ctor(ControllerContext controllerContext, IUnvalidatedRequestValues unvalidatedValues) +55 System.Web.Mvc.FormValueProviderFactory.GetValueProvider(ControllerContext controllerContext) +61 System.Web.Mvc.&lt;&gt;c__DisplayClassc.&lt;GetValueProvider&gt;b__7(ValueProviderFactory factory) +28 System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +238 System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +148 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +472 System.Linq.Enumerable.ToList(IEnumerable`1 source) +80 System.Web.Mvc.ValueProviderFactoryCollection.GetValueProvider(ControllerContext controllerContext) +347 System.Web.Mvc.ControllerBase.get_ValueProvider() +46 System.Web.Mvc.ControllerActionInvoker.GetParameterValue(ControllerContext controllerContext, ParameterDescriptor parameterDescriptor) +80 System.Web.Mvc.ControllerActionInvoker.GetParameterValues(ControllerContext controllerContext, ActionDescriptor actionDescriptor) +153 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +691 System.Web.Mvc.Controller.ExecuteCore() +162 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305 System.Web.Mvc.&lt;&gt;c__DisplayClassb.&lt;BeginProcessRequest&gt;b__5() +62 System.Web.Mvc.Async.&lt;&gt;c__DisplayClass1.&lt;MakeVoidDelegate&gt;b__0() +20 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +375 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload