-
Notifications
You must be signed in to change notification settings - Fork 2.1k
view not found after update to 2.0 rtm #6680
Comments
From @davidfowl on August 16, 2017 17:32 Change the page variable name to p in the route definition and method. See if that works. |
From @joeaudette on August 16, 2017 17:43 @davidfowl I confirm that changing the variable to p solved it |
From @joeaudette on August 16, 2017 17:44 @davidfowl but doing that also changed the url from http://localhost:55769/pager/4 to http://localhost:55769/pager?page=4 which wasn't desired |
From @davidfowl on August 16, 2017 18:4 There's another work around but that shouldn't happen with this one. Did you update the method parameter as well? |
From @joeaudette on August 16, 2017 18:8 ok, changing the method param and the asp-route param to p as well solved it and kept the desired url structure |
I'm moving this to the MVC repo where we can track the fix for this on our side. We don't intend for the 'pages' view search behavior to kick in unless you are using pages. |
FYI this has been logged as a bug: #6660 |
Yup @eat-sleep-code , this is a dup of #6600. Closing this since we've other work items tracking for the patch and 2.1.0 releases. |
From @joeaudette on August 16, 2017 16:31
I have encountered a strange problem in the demo app for my pagination library after updating to 2.0 rtm
The problem can be seen in the netcore20 branch of this repository by running the PagingDemo.Web app:
https://github.com/joeaudette/cloudscribe.Web.Pagination
In Startup I have routes like this:
I have a PagingController with an Index action method, and the view exists at Views/Paging/Index.cshtml
My Index ActionMethod looks like this:
When you click the PagingDemo1 link in the navigation the url is http://localhost:55769/pager and it finds the Index view as it should. However when I click one of the pagination links which passes a parameter for the page number for example http://localhost:55769/pager/4
I get an error:
InvalidOperationException: The view 'Index' was not found. The following locations were searched:
/Views/Shared/Index.cshtml
So for some strange reason it in not looking in the right place for the view, it should look in Views/Paging but it only looks in Views/Shared
As I recall it worked fine in preview2 and it also worked in 1.x. No other code changes have been made except updating to 2.0 dependencies and making the Program.cs and Startup.cs more like what the latest project templates provide.
Copied from original issue: dotnet/aspnetcore#2134
The text was updated successfully, but these errors were encountered: