?
=?ISO-8859-1?Q?S=E9bastien_Decoux?=
Hi !
I have a problem with a Web User Control who does not trigger the
RequiredFieldValidator Control...
I created a Web User COntrol who contain a TextBox. I created a property
to obtain and set the Text property of the TextBox, making it visible
outside of the control. I called this property "Text". (Originality,
Welcome)
Here's the code of the property :
[Bindable(true)]
[Description("Obtain or set the value insode the TextBox")]
[Category("Appearance")]
[DefaultValue("")]
public string Text
{
get
{
EnsureChildControls();
return this.txtDate.Text;
}
set
{
EnsureChildControls();
this.txtDate.Text = value;
}
}
Next, I wanted to be able to validate my control, wiwh means he can
trigger the validation controls (RequireFieldValidator,
RegularExpressionValidator,...)
I modified the declaration of my class to this :
[DefaultProperty("Text")]
[ValidationProperty("Text")]
[Designer(typeof(Designers.DatePickerDesigner))]
[ToolboxData("<{0}
atePicker runat=server></{0}
atePicker>")]
[ToolboxBitmap(typeof(System.Web.UI.WebControls.TextBox))]
public class DatePicker : System.Web.UI.WebControls.WebControl
The problem is every single validation controls works fine (Compare,
RegularExpression, Range, Custom), except the RequiredFieldValidator...
Anybody has an idea ?
I have a problem with a Web User Control who does not trigger the
RequiredFieldValidator Control...
I created a Web User COntrol who contain a TextBox. I created a property
to obtain and set the Text property of the TextBox, making it visible
outside of the control. I called this property "Text". (Originality,
Welcome)
Here's the code of the property :
[Bindable(true)]
[Description("Obtain or set the value insode the TextBox")]
[Category("Appearance")]
[DefaultValue("")]
public string Text
{
get
{
EnsureChildControls();
return this.txtDate.Text;
}
set
{
EnsureChildControls();
this.txtDate.Text = value;
}
}
Next, I wanted to be able to validate my control, wiwh means he can
trigger the validation controls (RequireFieldValidator,
RegularExpressionValidator,...)
I modified the declaration of my class to this :
[DefaultProperty("Text")]
[ValidationProperty("Text")]
[Designer(typeof(Designers.DatePickerDesigner))]
[ToolboxData("<{0}


[ToolboxBitmap(typeof(System.Web.UI.WebControls.TextBox))]
public class DatePicker : System.Web.UI.WebControls.WebControl
The problem is every single validation controls works fine (Compare,
RegularExpression, Range, Custom), except the RequiredFieldValidator...
Anybody has an idea ?