Render a ASP.NET MVC Razor view with a model from the controller.
Error / Exception
System.ArgumentException: Illegal characters in path.
The model from the controller was returning JSON and the view had declared “@model string” to handle the JSON.
Updates in both controller and view. Change controller return type from string to the object.
Original: return View(JsonConvert.SerializeObject(List));
Change to: return View(List);
Original: @model string
Change to: @model List<object>