Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Building Controls (http://www.velocityreviews.com/forums/f59-asp-net-building-controls.html)
-   -   Validator and custom control question (http://www.velocityreviews.com/forums/t756607-validator-and-custom-control-question.html)

Henk 04-13-2004 02:37 PM

Validator and custom control question
 
Hello,

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?

thnx
Henk


private void RenderTextbox( HtmlTextWriter output, TextBox textbox )

{

RenderTRTD(output);

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 );

}

RenderTRTDEnd(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.