H
Henk
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);
}
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);
}