asp.net mvc routing pattern is
{"some_parameter/{controller}/{action}/{id}"}
Is this a valid format if some_parameter can be null or string empty
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I believe that what you wanted is
{some_parameter}/{controller}/{action}/{id}(notice curly brackets around “some_parameter”) and in that case it shouldn’t be null or empty, I think. How do you think your end URL might look like to match the route in case whensome_parameteris empty? “mysite.com//mycontroller/myaction/myid”?Routing engine just matches patterns. If you want to handle both
{some_parameter}/{controller}/{action}/{id}and{controller}/{action}/{id}, just define both routes.