tags:

views:

195

answers:

1

Hi all,

I have two dropdowns in my form. Selected values from this dropdowns should be send to the proper route. One is called "category" and second is called "status". When I send my form I don't get expected:

Home/List/category/status adress

but something like this:

Home/List?category=category&status=status

how I can solve this? thanx

A: 

If you have parameters appended as a query string this means they don't have a place in the route so you have to setup a route for them. Somewhere in your route you need to have a place for them to fall.

You would need to add a route or change the default one to look like this...

routes.MapRoute(
    "MyRouteName",
    "Home/List/{category}/{status}",
    new { category = "default", status = "alsoDefault" }
    );

routes.MapRoute(
    "MyRouteName",
    "{controller}/{action}/{category}/{status}",
    new { controller = "Home", action = "Index", category = "default", status = "alsoDefault" }
    );
Chad Moran
that's it, thanx :)
Marko
the next problem that I have is: form request adress with list/category/status not with selected values like this for example: list/Articles/New
Marko