I am new to MVC land and have an application I'm working on. I have two different links with two routes in my global that are pretty similar to each other.
route 1
routes.MapRoute("Category", "Movies/{category}/{subcategory}", new { controller = "Catalog", action = "Index", category = "", subcategory = "" });
route 2
routes.MapRoute("Movie", "Movie/{movie}", new { controller = "Movie", action = "Index", movie = "" });
When I call actionlink for the first route, it creates it, since I think it should:
.../Movies/Category/SubCategory
however, when I create my second link, it fills it as follows:
.../Movie?movieId=ff569575-08ec-4049-93e2-901e7b0cb96a
I used the string instead of guid before and it still did the same ie
.../Movie?movieName=Snatch
my actionlinks are configured as follows
<%= Html.ActionLink(parent.Name, "Index", "Catalog", new { category = parent.Name, subCategory = "" }, null)%> <%= Html.ActionLink(movie.Name, "Index", "Movie", new { movieId = movie.MovieId }, null)%>
My application is still working, but I thought this behavior was strange. any help would be great.
Thanks!