Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 standard naming conventions

Author  Topic 

jhermiz

3564 Posts

Posted - 2004-09-30 : 13:21:17
Can anyone post a site with standard naming conventions for controls.

Like for a drop down list:

ddl

And all the other ones as well ?

Thanks,
Jon

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-09-30 : 13:28:16
I think you can figure out what these are for. If not, then they are bad naming conventions eh?
txt
dd or cbo
lst
dg
btn
chk
rdo
lnk

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-09-30 : 13:29:27
Thanks Mikey,

But isn't there a list somewhere online kind of like this one for VB:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconconstantvariablenamingconventions.asp

But i need it for the controls in ASP.net

Thanks,
Jon
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-30 : 13:31:01
I thought in .NET, prefixing them is gone:

http://www.mariosalexandrou.com/blog/index.asp?post=14

Tara
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-09-30 : 13:35:21
Hmm most of those comments say they stick to the conventions...
Does that article reflect on actual widgets (controls)
or procedures / modules...

Cause the MS article doesn't really state that...and I did notice that most people still use some kind of naming convention.

Maybe Ill have to dig this out of my Unleashed book.

Thanks all
Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-09-30 : 13:36:54
I think Tara is right that they are getting away from Hungarian notation since everything is an object and has a type. I like using the prefixes so I can see at a glance what type of object it is. This is handy when e-mailing code snippets that are ourside of the IDE. Also, I've been adding prefixes to stuff for so long, I'm just used to it I guess.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-09-30 : 13:36:55
Yes a lot of people are sticking with the "old ways". So it's up to you. Follow the standard that MS has proposed or the old way.

Tara
Go to Top of Page

jhermiz

3564 Posts

Posted - 2004-09-30 : 13:38:29
ok read this:

"When you read that MS frowns on Hungarian notation for classes, they are
talking about just that the class name, not the instance name.

I think you will find that the use of naming notations with controls is
still very much alive (remember a control that you use on your form is not
the class (TextBox), but an instance of a class (txtUser).

"

I think some people are sticking to it...
have to look around for how ASP.net controls are prefixed though

Go to Top of Page

MichaelP
Jedi Yak

2489 Posts

Posted - 2004-09-30 : 14:01:12
Yes, I agree with that. I don't call a class cObjectName, it's always just ObjectName.

Michael

<Yoda>Use the Search page you must. Find the answer you will.</Yoda>
Go to Top of Page

jsmith8858
Dr. Cross Join

7423 Posts

Posted - 2004-09-30 : 14:17:57
i use the prefix notation for controls only, never for variables.

Just my personal convention.


- Jeff
Go to Top of Page
   

- Advertisement -