stckvrflw
stckvrflw

Reputation: 1519

What does _Default keyword mean in c#

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

Answers (4)

masoud ramezani
masoud ramezani

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

Raithlin
Raithlin

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

Marcel Gheorghita
Marcel Gheorghita

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

Dave
Dave

Reputation: 15016

_Default isn't a keyword, it's your class name.

Upvotes: 15

Related Questions