Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Hi,
I had the same problem. I my case I solved it by making sure that the Index methods in the controller reflected that searchTerm and page parameters are both optional. Typically:
// search page - no query
public ActionResult Index(SearchPage currentPage)
// search query with query
[HttpPost]
public ActionResult Index(SearchPage currentPage, string searchTerm, int? page)
Thanks for your comment. Unfortunately both the searchTerm and page are optional so that hasn't corrected the issue.
Thank you though
Actually sorted this out. The home controller request was caused by a request to the favicon. Add this to the routing init module causes this to be igonore. Problem goes away
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
I've got a route which reponds to searchkeyword and page on a url e.g.
searchpage/searchkeyword/1
will go to the search page, search for the searchkeyword and display the 2nd page of results. I've used the following route
but every time I go to a page it will also fire up the index method on the home controller. The home controlle ris nothing special other than it servers out the root page of the site.
Does anyome know why it is doing that and how I can stop it
Many Thanks for any all help