c# - How to add extension to route ASP.NET -


this question has answer here:

i know if there way add extension end or uri in asp.net. normally, routeconfig configured this: url: "{controller}/{action}/{id}", so, result this: http://example.com/home/testpage/1, add extension end of uri (just fun, , know it), http://example.com/home/testpage/1.extension, possible do? , how can it?

you can use regular expression constraint parameter, {id:^.*\.(extension1|extension2)$}


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -