就是乱七八糟的东西放在一起!!
防止每次刷新/点击按钮时都对验证控件进行验证,把Button的CausesValidation属性设为false
构造函数没有返回值 不能用void /int等修饰
*.cs出现提示: Ctrl+J | Alt+→
Btton只有用鼠标点击时触发PostBack动作,即用Enter键时不触发该Button的PostBack动作
(焦点不会自动落到Button上)
UseSubmitBehavior属性置为:false
System.Text.RegularExpressions
System.Configuration.ConfigurationSettings.AppSettings["target"]
System.Configuration.ConfigurationManager.AppSettings["InfoRoleKey"]----recommend
System.Configuration.ConfigurationSettings.GetConfig("AX");
System.Web.HttpContext.Current;
System.Web.HttpContext.Current.Cache;
System.Web.HttpContext.Current.Session.Timeout
System.Reflection.Assembly
System.Web.HttpContext.Current ------------ -------------------//class 中使用Session
System.IO.Path.GetFileName
非Page用到Response
HttpResponse Response = HttpContext.Current.Response;
①script最好不要超过2000行
②你会做,并不意味这你应该做.(已方便用户为主)
③安全性:XHR必须包含URL,恶意用户可能会修改网站
可以察看源代码.
④XMLHttpRequest/远程脚本
⑤增加<tr>元素:将<tr>元素增加到表的<tbody>元素中
⑥设置class属性:<element>.style.cssText="font-weight:body";
代码片段:Tab Tab
重构:
①提取方法
②重命名
③提取接口
④将局部变量提升为参数
⑤移除参数
⑥重新排列参数
⑦封装字段
类设计器
VS2005新特征:
①Tab可以拖拽
②网站项目*.cs没有命名空间
③Debug有所增强
通过【即时窗口】改变当前要执行的语句
换算时间
正则表达式
二分查找
递归
装箱/拆箱
读写文件
通发??
二级域名怎么配置的??
< <
> >
& &
' '
" "
文件完整路径的正则表达式(包括网络路径): (([\w]+:)+\\|(\\\\))([^\/\\\"<>|:]+\\*)* 【RegexBuddy辅助完成】
不包含字符串:^AX_(?!zhz)[\w]+$ AX_zh能Match上.
.cs 的public var can be invoke by JS direct
DataTable转换为XML
判断上传文件的类型是否为 *.xml 类型
后台输出WebControl变量,供JS脚本使用(WebControl.ClientID)
获取当前登录用户
过滤DataTable
foreach语句 //DropDownList 同 ListBox (每个Item包含Text/Value对)
判断文件是否存在
File.Exist()也可以,
WinForm窗体重新画一遍
只有Repeater有RepeaterColumn属性(控制每行显示多少次循环)
对绑定的参数操作及传递多个参数(<asp:Image ></asp:Image>不能传递绑定的参数):
正则表达式替换:
客户端IP及来自的网页
HTML控件创建/添加/删除
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Made by AX</title>
<script language="javascript">
<!--
function ShowAD()
{
var ADString=GetAD();
var ADs=ADString.split("|");
var tr=document.createElement("<TR>");
for(var i=0;i<ADs.length;i++)
{
var AD=ADs[i].split(";");
var td=document.createElement("<TD>");
var a=document.createElement("<A target=_blank>");
a.href=AD[0];
a.innerHTML=AD[1];
td.appendChild(a);
tr.appendChild(td);
}
var tabElement=document.getElementById("tabAD");
var tbody=document.createElement("tbody");
tabElement.appendChild(tbody);
tbody.appendChild(tr);
}
function GetAD()
{
var ADString="http://www.163.com;网易|http://www.baidu.com;百度|http://www.sina.com;新浪";
return ADString;
}
//-->
</script>
</head>
<body onload="ShowAD();">
<table id="tabAD" width='400px' border='1' cellpadding='1' cellspacing='5'>
</table>
<br><br><br>
<div>①创建Element可以加<>,也可以不加,还可以带属性,<a target="_blank"><br>
②添加Element<br>
<ul><li>node.insertBefore(newChild,refChild):在refChild前插入子结点</li>
<li>node.appendChild(newChild);子结点插入到最后面</li>
<li>node.replaceChild(newChild,oldChild):替换子结点</li>
</ul>
③注意tbody<div/>
</body>
</html>
URL重定向完美版:(可扩展为根据host重定向)
①Global.asax.cs
②Web.config
字符串倒置(以前总笔试总也不敢确定,今天终于测试了一下,OK)
添加序号/编号
添加删除提示
类似Windows的长随即不重复字符串
CSS Style
DataTable添加另一个Table的一行
页面加载完后Show Alert
通过IP地址找到机器名
ping -a 172.25.0.1
限制HttpRequest的时间和数据大小
时间太小有可能会报这个异常:
Type 'System.Web.HttpApplication+CancelModuleException' in assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable.
TreeView的Node不做PostBack
博客园→斧头帮少帮主