Velocity Reviews

Velocity Reviews (
-   ASP .Net Building Controls (
-   -   Validator and custom control question (

Henk 04-13-2004 02:37 PM

Validator and custom control question

I have a custom control that overrides the base class render method. From
the Render method I got a call to the follwing method in the code snippet
below, problem is that the textbox gets rendered, but not the validator,
it's simply only leaving a span in the html page which prints the
erromessage, but no validation code, or even the ControlToValidate etc
params. Anyone having a clue what I am missing here?


private void RenderTextbox( HtmlTextWriter output, TextBox textbox )



output.Write ( "     " );

textbox.RenderControl( output );

// validator toevoegen

if ( this.Required )


m_oRFValidator = new RequiredFieldValidator();

m_oRFValidator.ErrorMessage = RFUtil.GetText( "RFV_ERRORMESSAGE" );

m_oRFValidator.ForeColor = System.Drawing.Color.Red;

m_oRFValidator.Display = ValidatorDisplay.Dynamic;

m_oRFValidator.EnableClientScript = true;

m_oRFValidator.ControlToValidate = textbox.ID;//.Replace( ":", "_");

m_oRFValidator.ID = "rfv" + textbox.ID;

m_oRFValidator.RenderControl( output );




All times are GMT. The time now is 10:25 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.