易截截图软件、单文件、免安装、纯绿色、仅160KB

ASP.NET编程规范之命名规范浅析

ASP.NET编程规范之命名规范都有哪些呢?具体又有什么内容呢?让我们开始吧:
ASP.NET编程规范之命名规范1.按钮ID命名:
btn+按钮操作功能(如btnSave)
ASP.NET编程规范之命名规范2.其它控件:
I.与数据操作相关:其ID<.SPAN>为相应的字段名称,如果有多个控件对应一个字段,则按以下规范命名:
字段名+”_”+顺序号(以01开头)
例子:页面有一TextBox控件,对应着数据库表中的RightGroup字段,则其ID应命名为RightGroup
如果页面有二个TextBox控件,都对应着数据库表中的PowerGroup字段,则其ID分别命名为PowerGroup_01,PowerGroup_02,依此类推
II.其它:前缀+用途功能(如txtInput),前缀参见下列:
控件前缀  Form frm  Class cls/C  Module mod  Label lbl  LinkLabe llnk  Button btn  TextBox txt  CheckBox chk  RadioButton rad  GroupBox grp  PictureBox pic  DataGrip grd  ListBox lst  CheckedListBox clst  ComboBox cbo  TreeView tvw  ListView lvw  TabControl tab  DateTimePicker dtp  Timer tmr  Splitter spl  ProgressBar pbar  RichTextBox rtf  ImageList imgl  ToolBar tlb  MenuItem mnu 
ASP.NET编程规范之命名规范3.变量及常量命名规范:
I.页面及过程级变量:级别标识+数据类型前缀+<名词|名词组合>
A、页面级变量:级别标识为m(例子:dimmstrNewlineasstring)
B、过程级变量:级别标识为l(例子:dimlstrNewlineasstring)
II.页面间变量:采用request传递获取
命名原则:级别标识+数据类型前缀+<名词|名词组合>
级别标识为p
例子:
url=”XXXX.aspx?pstrLine=bbbbb&pintN


相关文档:

asp.net生成静态页(之二)

先建个html模版页(template.htm):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 
<title>$title</title>
 
& ......

Asp.Net使用正则表达式解析中英文混排内容

给出一个字符串,如“中国China我爱你I love you”,程序可以实现中英文的区别;
识别结果如下:共四个元素
中国
China
我爱你
I love you
 
 
 string ptn = "[\u4e00-\u9fa5]+|[a-zA-Z\\s]+";
System.Text.RegularExpressions.Regex reg = new System.Text.RegularExpressions.Regex(ptn);
s ......

asp.net 程序动态添加gridview

前台:
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
   
   
     ......

Asp.net 中 Cookie的使用方法

方法1:
比如建立一个名为cnlive,值为"123"的cookie
HttpCookie cookie = new HttpCookie["cnlive"];
cookie.Value = "123";
Response.AppendCookie(cookie);
取刚才写入的Cookie值:
HttpCookie cookie = Request.Cookies["cnlive"];
cookieValue = cookie.Value;
在一个Cookie中储存多个信息:
HttpCookie cookie ......

学习asp.net C#

 1、DateTime   数字型  
System.DateTime   currentTime=new   System.DateTime();  
  1.1   取当前年月日时分秒  
currentTime=System.DateTime.Now;  
  1.2   取当前年  
int   年=currentTime.Year;  
  1.3   取当前月 &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号