How to resolve bad url in ASP.NET MVC 3

I want to pass the parameter to the url, but the localhost server will say that this is a bad URL. I can make them work in MVC 3

Url

http://localhost:6251/time/saturdau/first/second//nextparameter

you can see that the third parameter is empty here. This request may work when the 4th parameter passes without passing the third parameter.

what am i doing to make this work.

+3
source share
2 answers

rather put the work to it, let's say you make an agreement, if the parameter passed is null, you can try passing something like my_conventional_null_indicator

to look like this instead:

http://localhost:6251/time/saturdau/value1/34//70

do it

http://localhost:6251/time/saturdau/value1/34/my_conventional_null_indicator/70

but the best way would still be a common way

http://localhost:6251/time/saturdau?param1=value1&param2=34&param3=&param4=70

RouteValueDictionary.

0

. , URL. .

0

Source: https://habr.com/ru/post/1788400/


All Articles