// Repeater item binding event
Protected void rptCategory_ItemDataBound (object sender, RepeaterItemEventArgs e)
{
If (e. Item. ItemType = ListItemType. AlternatingItem | e. Item. ItemType = ListItemType. Item)
{
}
}
// Pop-up
Page. ClientScript. RegisterStartupScript (Page. ClientScript. GetType (), "myscript", "alert ('user has no permission! '); ", True );
// Ajax pop-up
ScriptManager. RegisterClientScriptBlock (upCatalog, typeof (UpdatePanel), "myscript", "alert ('enter the number! '); ", True );
// Confirmation box
OnClientClick = "return confirm ('Are you sure you want to delete this shipping address? ')"
// Email Verification
<Asp: regularExpressionValidator ID = "refUserNameOrEmail" runat = "server" ControlToValidate = "UserName" Display = "Dynamic" ErrorMessage = "Invalid email" ToolTip = "Invalid email" ValidationExpression = "[\ w \. -] + (\ + [\ w-] *)? @ ([\ W-] + \.) + [\ w-] +"
ValidationGroup = "CreateUserForm"> incorrect E-mail format </asp: RegularExpressionValidator>
// Only numbers can be entered
<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>
// Only Chinese characters can be entered
<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>
// Mobile phone Verification
<Asp: RegularExpressionValidator runat = "server" ID = "RegularExpressionValidator1" Display = "Dynamic" ControlToValidate = "txtMobileNumber" ErrorMessage = 'example: 100'
ToolTip = 'invalidemail 'ValidationGroup = "CustomerInfo" ValidationExpression = "^ (\ d {3} \) | (\ d {3 }\-))? 13 [0-9] \ d {8} | 15 [0-9] \ d {8} | 18 [0-9] \ d {8 }) "> </asp: RegularExpressionValidator>
Add serial number
<% # Container. ItemIndex + 1%>
<% # Container. DataItemIndex + 1%>
Author: "libt's column libt"