i’m looking at some pages, and i’ve noticed that by default for ID in the routing for controller/action/ID is an integer and not a string.
How can I change it so it is a string?
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.
Purely by creating an action like this:
The framework converts the url
MyController/MyAction/SomeIdfor you. Normally it would convert the last section into an integer as that is how your method is defined, there’s nothing to stop you from saying that it is a string and so no conversion is needed.