asp.net开发常用代码
来源:互联网 发布:淘宝无线运营中心网址 编辑:程序博客网 时间:2024/05/24 05:36
//Repeater项绑定事件
protected void rptCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
{
}
}
//弹出
Page.ClientScript.RegisterStartupScript(Page.ClientScript.GetType(), "myscript", "alert('用户没有权限!');", true);
//ajax弹出
ScriptManager.RegisterClientScriptBlock(upCatalog, typeof(UpdatePanel), "myscript", "alert('请填写编号!');", true);
//确认框
OnClientClick="return confirm('确认要删除此收货地址吗?')"
//Email验证
<asp:RegularExpressionValidator ID="refUserNameOrEmail" runat="server" ControlToValidate="UserName" Display="Dynamic" ErrorMessage="Invalid email" ToolTip="Invalid email" ValidationExpression="[\w\.-]+(\+[\w-]*)?@([\w-]+\.)+[\w-]+"
ValidationGroup="CreateUserForm">E-mail格式不正确</asp:RegularExpressionValidator>
//只能输数字
<asp:TextBox runat="server" ID="txtMobileNumber" CssClass="adminInput" onkeyup="value=value.replace(/[^\d]/g,'');" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"> </asp:TextBox>
//只能输中文
<asp:TextBox ID="txtLastName" runat="server" MaxLength="40" onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"></asp:TextBox>
//手机验证
<asp:RegularExpressionValidator runat="server" ID="RegularExpressionValidator1" Display="Dynamic" ControlToValidate="txtMobileNumber" ErrorMessage='例如:13854674256'
ToolTip='Invalid email' ValidationGroup="CustomerInfo" ValidationExpression="^(((\(\d{3}\))|(\d{3}\-))?13[0-9]\d{8}|15[0-9]\d{8}|18[0-9]\d{8})"> </asp:RegularExpressionValidator>
添加序列号
<%# Container.ItemIndex + 1%>
<%# Container.DataItemIndex+1 %>
- asp.net开发常用代码
- asp.net开发常用代码
- ASP.NET开发51种常用代码
- ASP.NET开发51种常用代码
- ASP.NET常用代码
- asp.net常用代码
- asp.net常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET常用代码
- ASP.NET 常用代码
- asp.net常用代码
- 移动设备流量剧增
- 简单的设置不简单:三例奇怪的无线路由器不能上网问题解决
- 一个普通IT人的十年回顾(转)
- javascript DOM 操作
- 微博营销兵法笔记
- asp.net开发常用代码
- Ogre HardwareBuffer
- 分析一下s3c6410的SD卡启动过程
- perl docs online
- 四元数与旋转
- dreamweaver技巧
- Google App Engine使用简介
- Java中IO的相关操作——节点流的知识
- Spring Jar包详解