一. 命名规范

    1 .Net控件命名规则

      控件标识符 +  意义标识符

  如:Lab标签

      Lab    +  UserName

  其他的控件标识符[主要是控件名简写,以及自己的习惯] : TextBox(Txt),Button(Btn),DropDownList(Drp) ....

 2.存储过程命名规范.

 (1) 存储过程前缀 + 表名 + [作用字段名]+功能标识符

  UP     + TableName+ ByID  + Sel

     即:UserProcedure +TableName +ByID +Select

     Select---->Sel

   Update--->Upd 

   Delete---->Del

     Insert---->Ins

  (2)其他存储过程采用

   Get + xx + By + Parameter或者

   Get + xx + By +   Parameter1 + Parameter2

二.网页对应CS文件编写规范.

 

代码
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();
//首先初始化控件,主要用来绑定控件的值
BindStyle(); //用来设置某些控件的样式,或者是否需要显示等等.
BindJsEvents(); //加载控件需要执行的事件,一般是JS事件
}
}

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();
}

}

}

 

 

三.变量命名规范.

1.类中公共全局变量命名:UpperCase

2.类中私有全局变量命名:lowerCase

3.方法中变量命名:lowercase

 

文章很初级..待续啊...有什么不好的。希望路过的朋友提出来哈。

   

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-07
  • 2021-11-26
  • 2021-11-23
  • 2022-12-23
猜你喜欢
  • 2022-01-14
  • 2021-05-20
  • 2021-10-12
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
相关资源
相似解决方案