|
using System;
using HtmlGen;
namespace HtmlGen
{
/// <summary>
/// Summary description for Label.
/// </summary>
public class Validator:Common
{
private System.Text.StringBuilder strBuilder = new System.Text.StringBuilder();
private string strErrorHeader;
private string ErrorMessage;
private string strErrorFooter;
private string strValidateHeader;
private string Validate;
private string strValidateFooter;
public Validator()
{
}
public Validator(string name,string errormessage,string ControlName,int left,int top,int tabindex,int StyleCount)
{
this.MAJORHEADER="<asp:";
this.CONTROLHEADER="requiredfieldvalidator";
this.CONTROLFOOTER=">";
this.MAJORFOOTER="</asp:requiredfieldvalidator>";
this.strErrorHeader =" ErrorMessage=" + Quote;
this.ErrorMessage= " Please Enter " + errormessage;
this.strErrorFooter= Quote + " ";
this.strValidateHeader =" ControlToValidate=" +Quote;
this.Validate=ControlName;
this.strValidateFooter =Quote + " ";
this.STYLECOUNT=StyleCount;
this.STYLE = " style=" +Quote + "Z-INDEX:" + this.STYLECOUNT.ToString()+ ";" ;
this.ID=name;
this.LEFT=left;
this.TOP=top;
this.TABINDEX=tabindex;
}
public override string ToString()
{
strBuilder.Append(this.MAJORHEADER);
strBuilder.Append(this.CONTROLHEADER);
strBuilder.Append(this.IDHEADER);
strBuilder.Append(this.ID.ToString());
strBuilder.Append(this.IDFOOTER);
strBuilder.Append(this.STYLE);
strBuilder.Append(this.STRLEFTHEADER);
strBuilder.Append(this.LEFT.ToString());
strBuilder.Append(this.STRLEFTFOOTER);
strBuilder.Append(this.POSITION);
strBuilder.Append(this.STRTOPHEADER);
strBuilder.Append(this.TOP.ToString());
strBuilder.Append(this.STRTOPFOOTER);
strBuilder.Append(this.Quote);
strBuilder.Append(" ");
strBuilder.Append(this.STRTABINDEXHEADER);
strBuilder.Append(this.TABINDEX.ToString().TrimStart(null));
strBuilder.Append(this.STRTABINDEXFOOTER);
strBuilder.Append(this.RUNATSERVER);
strBuilder.Append(this.strErrorHeader);
strBuilder.Append(this.ErrorMessage);
strBuilder.Append(this.strErrorFooter);
strBuilder.Append(this.strValidateHeader);
strBuilder.Append(this.Validate);
strBuilder.Append(this.strValidateFooter);
strBuilder.Append(this.CONTROLFOOTER);
strBuilder.Append(this.MAJORFOOTER);
return strBuilder.ToString();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Balachandar Ganesan has been working in CGI India for the last 6 years. ASP.NET, SQL Server 2000, Crystal Reports, Database Performance tuning, ETL, Actuate, Cobol, CICS,DB2, Easytrieve, Flash, PaintShop Pro , SoundForge are few of the various technologies with which he has worked.
He is known for ability to generate applications with "just good enough" features in a short time.
He has written whitepapers on Software development process improvement as well.
Image, Video and Audio editing are his hobbies. He is also the editor of his company newsletter, Manager of cricket and volleyball teams, Vice-President of Toastmasters club.