I. Naming rules
1. Net Control naming rules
Control identifier + meaning identifier
For example, Lab labels
Lab + UserName
Other control identifiers [abbreviated control names and their habits]: TextBox (Txt), Button (Btn), DropDownList (Drp )....
2. Stored Procedure naming rules.
(1) Stored Procedure prefix + Table name + [field name] + Function Identifier
UP + TableName + ByID + Sel
That is, UserProcedure + TableName + ByID + Select
Select ----> Sel
Update ---> Upd
Delete ----> Del
Insert ----> Ins
(2) other stored procedures
Get + xx + By + Parameter or
Get + xx + By + Parameter1 + Parameter2
Ii. Specification for compiling CS files on the webpage.
Code
Using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Namespace WebUI. Manage. Manageyewu
{
Protectedvoid Page_Load (object sender, EventArgs e)
{
If (! IsPostBack)
{
BindControls (); // initialize the control first, mainly used to bind the Control Value
BindStyle (); // used to set the style of some controls or whether to display them.
BindJsEvents (); // events to be executed when the control is loaded, typically JS events.
}
}
Privatevoid BindStyle ()
{
ChangeLabUserDisplay ();
}
Privatevoid ChangeLabUserDisplay ()
{
BtnSelCheckBox. Style. Add ("Display", "none ");
}
Privatevoid BindJsEvents ()
{
SelAllCheckBox ();
}
Privatevoid SelAllCheckBox ()
{
BtnSelCheckBox. Attributes. Add ("onclick", "return CheckSe ()");
}
Privatevoid BindControls ()
{
BindRepNews ();
}
Privatevoid BindRepNews ()
{
RepNews. DataSource = Dt;
RepNews. DataBind ();
}
}
}
Iii. variable naming rules.
1. Name the public global variable in the class: UpperCase
2. Name the private global variable in the class: lowerCase
3. variable name in the method: lowercase
The article is very elementary... To be continued... what's wrong. I hope a friend passing by will come up with me.