Thursday 26 July 2012

ValidationSummary in ASP.NET | How to use ValidationSummary in ASP.NET | What is the use of ValidationSummary in ASP.NET

Hi friends, in this article I will explain about How to use ValidationSummary control in ASP.NET, Custom Validation Summary in ASP.NET.
The ValidationSummary control is used to display a summary of all validation errors occurred in a Web page.
The error message displayed in this control is specified by the ErrorMessage property of each validation control. If the ErrorMessage property of the validation control is not set, no error message is displayed for that validation control.

CustomValidator Control in ASP.NET | What is the use of CustomValidator Control in ASP.NET | How to use the CustomValidator Control in ASP.NET

Hi friends, in this article I will explain about CustomValidator Control, How to Validate with a Custom Function for ASP.NET Server Controls, ASP.NET CustomValidator Control.
CustomValidator   is used to writing application specific custom validation routines. We can use ASP.NET CustomValidator control to validate either client side or at server side.
I will explain CustomValidator   example in 2 ways

What is RegularExpressionValidator Control in ASP.NET | What is the use of RegularExpressionValidator Control in ASP.NET | How to use RegularExpressionValidator Control in ASP.NET

                                     Hi friends, in this article I will explain about RegularExpressionValidator for Email ID in ASP.NET or  ASP.NET RegularExpressionValidator example.
The RegularExpressionValidator control is used to check that an input value matches a specified pattern or not.
I will explain this with small example.
Take one new web site(file--- new website--- give name o the website).
Take one webpage name it as resularexp.aspx and drag and drop the RegularExpressionValidator as shown in the below figure.



And write the following code in the .aspx source file.
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="regularexp.aspx.vb" Inherits="regularexp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>RegularExpressionValidator for Email ID</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <h1 style="color:Green ">RegularExpressionValidator for Email ID</h1>
    Enter Email Adress:<asp:TextBox ID="Email" runat="server" Width="240px"></asp:TextBox>
    <asp:RegularExpressionValidator
                ID="RegularExpressionValidator1"
                runat="server"
                ErrorMessage="Email missed @ or ','.Pls Check once and Enter Valid Email ID"
                ValidationGroup="rgSubmit"
                ControlToValidate="Email"
                CssClass="requiredFieldValidateStyle"
                ForeColor="Red"
                ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*">
    </asp:RegularExpressionValidator>
    </div>
    </form>
</body>
</html>

In the above web page.I put the code for cheching the email address.It checks only @ and ‘,’ is there or not.If  either @ or ‘,’ miss it will raise the error Email missed @ or ','.Pls Check once and Enter Valid Email ID .Run the code. It will like below .if you don’t enter valid email address it will shown like below figure.


in previous articles i explained about validation controls in ASP.NET and how to use the validation controls in ASP.NET.
CompareValidator in ASP.NET
CustomValidator Control, How to Validate with a Custom Function for ASP.NET Server Controls, ASP.NET CustomValidator Control.
RegularExpressionValidator for Email ID in ASP.NET or ASP.NET RegularExpressionValidator example.
ValidationSummary in ASP.NET
 I think you like my blog Aspdotnet-Kishore why are waiting following me on facebook fan page Aspdotnet-Kishore

Monday 23 July 2012

ASP.NET Validation Controls with example | How to use ControlValidator in ASP.NET | ControlValidator Control in ASP.NET

                                   Hi Friends, in this article i will explain about the CompareValidator in the ASP.NET. CompareValidator is used to compare the value of one input control with value of another input control or a fixed value.
                                   I already explained in the previous article ASP.NET Validation Controls with example | How to use Validation Controls in ASP.NET | RequiredFieldValidation Control in ASP.NET
© 2012-2018 Aspdotnet-Kishore.blogspot.com. All Rights Reserved.
The content is copyrighted to Kishore and may not be reproduced on other websites without permission from the owner.