Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
CSS
I have a project developed in asp.net MVC3 but its default router can not sign "-". Now I want the router as an example URL:
http://localhost:3578/Trang-chu/am-nhac/bai-hat-english.
How to do it?
Posted

You can have the hyphen in any action parameters without any change. To have hyphen in action name, you can provide it as an attribute like
C#
[ActionName("In-dex")]
 public ActionResult Index()


So the URL will contain In-dex for the action.

Anyways, I didn't see any point in having - in the actionname it will be confusing.
 
Share this answer
 
Comments
Member 8070609 29-Jul-13 1:33am    
I'd like controller called with "-". for example:am-nhacController.csBut I do not run it.
Are you sure that parameters can't exist '-' ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900