S
Sogescom
I tried to make a control with a label a text box and a
required fiel validator, but i always reiceved this error:
Unable to find control id 'FormField:Address1' referenced
by the 'ControlToValidate' property of ''.
What i'm doing wrong???
this is the to main method
protected override void CreateChildControls()
{
TextBox tbxAddress = new TextBox();
Label lblMessage = new Label();
RequiredFieldValidator req = new RequiredFieldValidator();
lblMessage.Text= "";
Controls.Add(lblMessage);
tbxAddress.ID = "FormField:Address1";
Controls.Add(tbxAddress);
req.ControlToValidate = tbxAddress.ID;
req.ErrorMessage = InvalidMessage ;
Controls.Add(req);
}
protected override void Render(HtmlTextWriter output)
{
EnsureChildControls();
base.Render(output);
}
required fiel validator, but i always reiceved this error:
Unable to find control id 'FormField:Address1' referenced
by the 'ControlToValidate' property of ''.
What i'm doing wrong???
this is the to main method
protected override void CreateChildControls()
{
TextBox tbxAddress = new TextBox();
Label lblMessage = new Label();
RequiredFieldValidator req = new RequiredFieldValidator();
lblMessage.Text= "";
Controls.Add(lblMessage);
tbxAddress.ID = "FormField:Address1";
Controls.Add(tbxAddress);
req.ControlToValidate = tbxAddress.ID;
req.ErrorMessage = InvalidMessage ;
Controls.Add(req);
}
protected override void Render(HtmlTextWriter output)
{
EnsureChildControls();
base.Render(output);
}