473,322 Members | 1,911 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Asp.net name convention

I usually name the controls as txtSomething, ddlSomething, gvSomething.
However, the FXCop indicate it's an error and Pascal convention is preferred.
Any good suggesion on ASP.Net control name convention?
Mar 28 '07 #1
2 4168
It looks like you're still using Hungarian Notation. That's considered
rather old fashioned these days.
I've covered the details about why it's no longer recommended here:
http://SteveOrr.net/faq/HungarianNotation.aspx

Here are Microsoft's recommended naming conventions:
http://msdn2.microsoft.com/en-us/library/ms229045.aspx

And here's more info about Pascal case and Camel case:
http://msdn2.microsoft.com/en-us/library/ms229043.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"nkw" <nk*@discussions.microsoft.comwrote in message
news:72**********************************@microsof t.com...
>I usually name the controls as txtSomething, ddlSomething, gvSomething.
However, the FXCop indicate it's an error and Pascal convention is
preferred.
Any good suggesion on ASP.Net control name convention?
Mar 28 '07 #2
Thanks. I following the rules for C# classes. However,

From the first link:

"For these reasons the vast majority of developers no longer need or use
Hungarian Notation. Those that do still use it tend to use it only to prefix
standard controls, so you might still see something like "txtFirstName"
around the net here and there."

For example, when build an asp.net page with a gridview for customer, you
may have a gridview, object data source, etc for customers. How to name them
if not have any meta type string for the control name?

"Steve C. Orr [MCSD, MVP, CSM, ASP Inside" wrote:
It looks like you're still using Hungarian Notation. That's considered
rather old fashioned these days.
I've covered the details about why it's no longer recommended here:
http://SteveOrr.net/faq/HungarianNotation.aspx

Here are Microsoft's recommended naming conventions:
http://msdn2.microsoft.com/en-us/library/ms229045.aspx

And here's more info about Pascal case and Camel case:
http://msdn2.microsoft.com/en-us/library/ms229043.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"nkw" <nk*@discussions.microsoft.comwrote in message
news:72**********************************@microsof t.com...
I usually name the controls as txtSomething, ddlSomething, gvSomething.
However, the FXCop indicate it's an error and Pascal convention is
preferred.
Any good suggesion on ASP.Net control name convention?
Mar 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Todd Gardner | last post by:
Pardon my extremely ignorant newbie questions. Where can I go to find more information about the "self" argument? Is there something special about the word "self" or did Mr. Guido van Rossum...
6
by: yyy | last post by:
my question is rather theoretical than practical in the pure programming aspect... is "name mangling" the same as "name decorating" ? browsing the web, you might find multiple people saying...
12
by: christopherlmarshall | last post by:
Suppose you want to write a subclass of some existing class you are importing from a module you didn't write and that you don't want to study the internals of, and you want to define a data member...
7
by: robert | last post by:
well, i can't remember being limited to 8 characters for something, except in the good ole days of M$-dos. now i find that DB2/390 has a 8 character limit on tablespace names?!?!?!?!? given...
2
by: Tyno Gendo | last post by:
I'm writing a test "modular site". So far I have created an App class, a Module Manager class and a couple of test modules. The Manager looks in a directory called 'modules' and then for every...
16
by: xz | last post by:
For example, I have a Class Date with internal variable year, month and day. In Java I would write: class Date{ int year; int month; int day; Date(int year, int month, int day) { this.year...
3
by: Ronald S. Cook | last post by:
For all those anti-Hungarian notation people out there, how would you name an employee first name label and textbox on an create/modify employee form, respectively (please)? Thanks, Ron
50
by: John Salerno | last post by:
I know it's popular and very handy, but I'm curious if there are purists out there who think that using something like: for x in range(10): #do something 10 times is unPythonic. The reason I...
5
by: puzzlecracker | last post by:
public delegate MessageHandler(Request request) public sealed class Connection{ public event MessageHandler handler; private void ExecuteMassageHandler(Request request) {
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.