I'd like to name one of my APS.NET MVC 4.0 Areas "Public". When I add a new Area and names it "Public" Visual Studio instead gives me the name "_Public" - obviously protecting me from using a C# keyword for the Area. The name would be used both in the namespace and as a part of the class name of PublicController
. I'd prefer that my public-facing URL didn't contain any underscores, so I've done a rename back to "Public" and so far it seems to work just fine - my Index-page is rendering fine.
Is there any reason I shouldn't go with "Public" without the underscore as the area name? What problems will I face in the future, if any?
No Problem, It's generally a best practice to avoid reserved keyword. For now, there is no constraint from MVC side.
It'll not create any problem in future for sure. In case you require advance routing please refer following link
MVC custom routing with validation
Hope helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With