c# - Control/variable naming conventions in ASP.NET -


i think main distinction in naming between logic , view-related objects. might have variable named “username” in code behind file of page, .net textbox in user supposed enter username (a sensible id “username”). how can differentiate (id-wise), between logic “username” , view “username”. question is, sensible distinction make when coming these names?

in opinion, variable name/control id should never describe is, does. “tbusername” describes textbox, “strusername” defines string.

one idea prefix view related objects “vwusername” , keep logic part “username”. make sense? when have situation have validators? name them “vwusernamerequiredvalidator”, or “vwemailaddressformatvalidator”? in situation need describe is? give .net requiredfieldvalidator object id of “rfvusername”?

i want idea of other people think on this, because want come sensible , consistent naming convention system going forward. i’m interesting hear arguments type of system.

hungarian notation 1990s... ;-)

i use username logic , username id.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -