Changing MVC router id from integer to string in vb.net
1 answer
Cleanly by creating an action like this:
Public Function MyAction(ByVal id as String) as ActionResult
The structure will convert the URL MyController/MyAction/SomeId
for you. It will usually convert the last section to an integer, since this is how your method is defined and you have nothing to prevent you from saying it is a string, so no conversion is required.
+3
source to share