Groups | Blog | Home
all groups > asp.net webcontrols > july 2003 >

asp.net webcontrols : Custom WebControl.



George Ter-Saakov
7/31/2003 11:20:41 AM
Hi. I am writing my own Validation control to validate the length of the
inputted string. Use RegExp seems to me an overkill for such simple task.

Anyway I declared my control as

public class GLengthValidator : WebControl, IValidator

Then I overwrote the Render method

protected override void Render(HtmlTextWriter writer)
{
if( _isValid )
return; //do not output anything if it's valid.
else
writer.Write("This is a tesT"); //show something if it's invalid.
}

The thing is that in VS when i place control on form it shows
[GLengthValidator "GLengthValidator1"]

What should i do to show my own staff during the design time?

Thanks.
George.

jan v
7/31/2003 5:25:51 PM
inherit from
BaseValidator

greetzzz

[quoted text, click to view]

AddThis Social Bookmark Button