Intro
I'm developing a project with MVC.Net. I have just started a default website with a Home Controller and an Index action. I browse to the view with 'Home/Index/1'
and everyting works fine.
Now I want to add an extra url parameter, so I've changed my global.asax and added a foo parameter:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}/{foo}", // URL with parameters
new {controller = "Home", action = "Index", id = UrlParameter.Optional, foo = UrlParameter.Optional} // Parameter defaults
);
On the page I also have a little bit of jquery. For example this script:
<script type="text/javascript">
$(document).ready(
function ()
{
});
</script>
Problem
But now when I browse to my page with 'Home/Index/1/1' I get a javascript error:
Microsoft JScript runtime error: Object expected
When I browse to the page with 'Home/Index/1'
everything works fine. Probably there's a problem with my url routing, but I have no clue what I'm doing wrong.