By default if url is ‘mydomain’ it go to controller home; action = index.
But when index action has params the url have to be:
mydomain/home/index?name=John
want to get:
mydomain?name=John
What should be define for create such url?
Thanks,
Yosef
Are you sure you want
mydomain/home/index?name=Johnandmydomain?name=Johnas your urls in your site?If you corrected your routing engine, your routes could be,
mydomain/home/index/johnandmydomain/john, which to me would be more correct.Is that what you’re going for?
If so, assuming you have a Index action, accepting a string parameter of name in your home controller, you could modify your global.asax, and change the default route, and add a route below the standard default route like this:
Be sure you put the name only route at the bottom, as a string based parameter will match everything, so you need to match the more explicit ones first.