asp.net MVC 3 RegisterArea with multiple optional id's not working -


i trying capture multiple optional parameters in asp.net web application. when define maproute in registerarea(), breaking html.actionlink() methods.

the following code works:

    public overrides sub registerarea(byval context system.web.mvc.arearegistrationcontext)         context.maproute( _             "register_default", _             "register/{controller}/{action}/{id1}", _             new {.controller = "home", .action = "index", .id1 = urlparameter.optional} _         )     end sub 

but when modify url include multiple optional parameters (below), causing of html.actionlink() methods create anchor tags empty hrefs. can tell me causing happen?

    public overrides sub registerarea(byval context system.web.mvc.arearegistrationcontext)         context.maproute( _             "register_default", _             "register/{controller}/{action}/{id1}/{id2}/{id3}/{id4}", _             new {.controller = "home", .action = "index", .id1 = urlparameter.optional, .id2 = urlparameter.optional, .id3 = urlparameter.optional, .id4 = urlparameter.optional} _         )     end sub 

it's bug in mvc3/system.web.routing:

http://haacked.com/archive/2011/02/20/routing-regression-with-two-consecutive-optional-url-parameters.aspx


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -