How to create an action name that starts with a number in ASP.NET MVC?

I want to name the action of the ASP.NET MVC controller as 123games, but this does not allow me due to numeric numbers.

Do I need to use ActionNameAttribute?

+5
source share
1 answer

Yes Yes. The C # language specification prohibits identifiers starting with a number according to section 2.4.2, "Identifiers"

character start id:

  • letter symbol
  • _ (underscore U + 005F)

Note the absence of any numerical value.

, ActionNameAttribute , ( URL- ),

[ActionName("123games")]
public ActionResult _123Games()
{
     // Action code.
}

, ( , , ).

, , , Unicode Standard 15, , , ( C)...

, (.. _123Games), # , URL-.

+9
source

All Articles