Tuesday, May 14, 2013

RequiredFieldValidator Control asp.net

RequiredFieldValidator Control

Evaluates the value of an input control to ensure that the user enters a value.

Syntax :

<asp:RequiredFieldValidator ID="req" runat="server" ControlToValidate="txt" ErrorMessage="Please Enter Required value" Display="Dynamic" ></asp:RequiredFieldValidator>

Where

   ControlToValidate= "Control which have to validate"
    ErrorMessage ="Define custom error message
"  Display= "Error message display property :
                   Three types Dynamic,Static,None


Example :

Default.aspx :

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>Required Field validator Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <h1>
    Required Field validator Example
    </h1>
    <div>
    <asp:TextBox ID="txt" runat="server"></asp:TextBox>
   
    <asp:RequiredFieldValidator ID="req" runat="server" ControlToValidate="txt" ErrorMessage="Please enter text box value" Display="Dynamic"></asp:RequiredFieldValidator>
        <asp:Button ID="Button1" runat="server" Text="Submit" CausesValidation="true"/>
   
    </div>
    </form>
</body>
RequiredFieldValidator Control asp.net</html>
           
Download Source code : RequiredFieldValidator Control asp.net

If you are searching life partner. your searching end with kpmarriage.com. now kpmarriage.com offer free matrimonial website which offer free message, free chat, free view contact information. so register here : kpmarriage.com- Free matrimonial website

Related Posts:

  • SQL JOIN table.reference tr.fixzebra { background-color: #F6F4F0; } table.reference th { background-color: #555555; border: 1px solid #555555; … Read More
  • SQL RIGHT JOIN SQL RIGHT JOIN Keyword The RIGHT JOIN keyword returns all the rows from the right table (table_name2), even if there are no matches in the left tab… Read More
  • SQL FULL JOIN SQL FULL JOIN Keyword The FULL JOIN keyword return rows when there is a match in one of the tables. SQL FULL JOIN Syntax SELECT column_name(s) FR… Read More
  • ASP.NET Page Life Cycle Overview When an ASP.NET page runs, the page goes through a life cycle in which it performs a series of processing steps. These include initialization,… Read More
  • SQL INNER JOIN Keyword SQL INNER JOIN Keyword The INNER JOIN keyword returns rows when there is at least one match in both tables. SQL INNER JOIN Syntax SELECT column_n… Read More

0 comments:

Post a Comment