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
Post a Comment