<asp:TextBox ID="txtEmailid" runat="server" Width="180px" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"> <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtEmailid" ErrorMessage="Invalid" ForeColor="#F04E23" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
protected void btnsave_Click(object sender, EventArgs e) { Page.Validate(); if (txtMobileNo.Text == "") { lblErr.Text = "Enter the Mobile No"; txtMobileNo.Focus(); return; } else if (txtPhoneNo.Text == "") { lblErr.Text = "Enter the Phone No"; txtPhoneNo.Focus(); return; } else if (txtFax.Text == "") { lblErr.Text = "Enter the Fax No"; txtFax.Focus(); return; } else if (txtEmailid.Text == "") { lblErr.Text = "Enter the Email Id"; txtEmailid.Focus(); return; } else if (txtAddress.Text == "") { lblErr.Text = "Enter the Address "; txtAddress.Focus(); return; } else { sales.Save(); lblErr.Text = "Details Saved Successfully"; GridBindData(); Clear(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)