ValidationSummary control example
Previous | Home | Next |
A ValidationSummary control is displayed when the IsValid property of the page is false. It "polls" each of the validation controls on the page and aggregates the text messages exposed by each.
Property:= DisplayMode :-How to display the summary. Legal values are: BulletList List SingleParagraph EnableClientScript :-A Boolean value that specifies whether client-side validation is enabled or not Enabled :-A Boolean value that specifies whether the validation control is enabled or not ForeColor :-The fore color of the control HeaderText:- A header in the ValidationSummary control id A unique id for the control runat :-Specifies that the control is a server control. Must be set to "server" ShowMessageBox:- A Boolean value that specifies whether the summary should be displayed in a message box or not ShowSummary:- A Boolean value that specifies whether the ValidationSummary control should be displayed or hidden
...........Design code for validationsummary control................ ................................................................... <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>...........................................................................................cs code..................................... using System; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { Response.Write("Successful"); } } ....................................................................Untitled Page
Previous | Home | Next |