T
Tumurbaatar S.
I'm trying to dynamically hide/show a HTML table server control.
My form contains one CheckBox control and its AutoPostBack set to true.
The Checked value of this box controls whether to show or hide the table.
Initially this CheckBox is not checked, so the table and all web control it
contains
is not rendered to a client. The table contains several TextBox controls and
each TextBox has a pair of RequiredFieldValidator and CompareValidator.
When I click the previous checkbox, the form postbacks and the server side
code sets HtmlTable.Visible to true. Now all TextBoxes appear at the client
side,
BUT ALL validators indicate failure by showing theirs Text message. Why?
When I do not hide/show the table and it is always visible, the validators
work normally.
This only happens when the table and its content (the textboxes and
validators)
are dynamically showed/rendered. As I know, the CheckBox's AutoPostBack
does not trigger a validation process. Any ideas?
I tried to trace my page and set several breakpoints at Page_Load, PreRender
and
CheckBox_CheckedChanged. At these points I checked values of the IsValid
properties
of the validators. They were always TRUE. I wonder when they switches to
FALSE?
If I'm right, a validator displays the Text only when IsValid is false. Yes?
My form contains one CheckBox control and its AutoPostBack set to true.
The Checked value of this box controls whether to show or hide the table.
Initially this CheckBox is not checked, so the table and all web control it
contains
is not rendered to a client. The table contains several TextBox controls and
each TextBox has a pair of RequiredFieldValidator and CompareValidator.
When I click the previous checkbox, the form postbacks and the server side
code sets HtmlTable.Visible to true. Now all TextBoxes appear at the client
side,
BUT ALL validators indicate failure by showing theirs Text message. Why?
When I do not hide/show the table and it is always visible, the validators
work normally.
This only happens when the table and its content (the textboxes and
validators)
are dynamically showed/rendered. As I know, the CheckBox's AutoPostBack
does not trigger a validation process. Any ideas?
I tried to trace my page and set several breakpoints at Page_Load, PreRender
and
CheckBox_CheckedChanged. At these points I checked values of the IsValid
properties
of the validators. They were always TRUE. I wonder when they switches to
FALSE?
If I'm right, a validator displays the Text only when IsValid is false. Yes?