views:

357

answers:

4

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 ?

+13  A: 

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

Dave
Then why is it coloured ? What is the special thing about it ?
stckvrflw
it's just a setting of your IDE (eg. visual studio) (color of classNames)
Andreas Niedermair
I can't comment for web development directly, but my class names always appear colored once they are resolved correctly by Intellisense.
Dave
Andreas had a better answer, you can just change it even if you really want to.
Dave
+1  A: 

It is not a keyword, that is the name of the class. Variable names can start with a-z, A-Z, and '_'.

Marcel Gheorghita
A: 

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.

Raithlin
True, but completely out of context with this question
Keith Rousseau
Wrong context .
Simon P Stevens
@Keith - I added a short comment, then edited to expand (while you commented). Hopefully it makes more sense now.
Raithlin
out of context. missing `default()`, just to be complete!
Andreas Niedermair
+1  A: 

keyword names are lowercase. this is your class name. if your page name is default, asp.net get this name to it's class.

masoud ramezani