Reputation: 1519
For example, I have created a webpage and it has _Default keyword in it.
public partial class _Default : System.Web.UI.Page
What does that keyword do in here? What is the point ?
Upvotes: 3
Views: 3039
Reputation: 22950
keyword names are lowercase. this is your class name. if your page name is default, asp.net get this name to it's class.
Upvotes: 1
Reputation: 1774
default is a keyword used in the C# switch statement, and in VB.Net applies to a default property. That's why the IDE renamed your class _Default, based on the name of the page (Default.aspx). _Default is in itself not a keyword, and appears to be colored differently because every other word on that line is a keyword.
Upvotes: 5
Reputation: 1873
It is not a keyword, that is the name of the class. Variable names can start with a-z, A-Z, and '_'.
Upvotes: 1