C
clintonG
Technically speaking, this issue is not about modifying the HTML
generated by server controls but preceding the HTML generated by
server controls with an HTML control generated on the basis of the
type and the context of the server control itself. Clear as mud?
Consider the following server control...
<asp:textbox id="MemberEmail" runat="server" ></asp:textbox>
TextBox renders at run-time as an HTML control...
<input name="MemberEmail" type="text" id="MemberEmail" ... />
Section508 Accessibility requires the TextBox server control to
be preceded by the following HTML control...
<label for="MemberEmail">E-mail:</label>
<asp:textbox id="MemberEmail" runat="server" ></asp:textbox>
As I understand it, at run-time, a screen reader will stop on the
HTML label control named 'MemberEmail', read it aloud and put
the focus on the rendered input control allowing the person to enter
data into the form field.
Preceding the TextBox Server Control with a Label Server Control
is out of the question as the screen reader will not read what the
Label Server Control renders at run-time...
<span id="lblMemberEmail">E-mail</span>
I can get properties of the TextBox control(s) using...
foreach (Control ctl in parent.Controls) ...and I can use those properties
to build the HTML label control but I don't know how to output and
render the HTML label control so it will precede its respectively rendered
TextBox control in the HTML that is generated when the TextBox
Server Control is rendered ar run-time.
I hope this makes sense and somebody can comment as it is much more
effective to automate a page to validate and function as Section508
accessible
than to write each HTML label control manually.
generated by server controls but preceding the HTML generated by
server controls with an HTML control generated on the basis of the
type and the context of the server control itself. Clear as mud?
Consider the following server control...
<asp:textbox id="MemberEmail" runat="server" ></asp:textbox>
TextBox renders at run-time as an HTML control...
<input name="MemberEmail" type="text" id="MemberEmail" ... />
Section508 Accessibility requires the TextBox server control to
be preceded by the following HTML control...
<label for="MemberEmail">E-mail:</label>
<asp:textbox id="MemberEmail" runat="server" ></asp:textbox>
As I understand it, at run-time, a screen reader will stop on the
HTML label control named 'MemberEmail', read it aloud and put
the focus on the rendered input control allowing the person to enter
data into the form field.
Preceding the TextBox Server Control with a Label Server Control
is out of the question as the screen reader will not read what the
Label Server Control renders at run-time...
<span id="lblMemberEmail">E-mail</span>
I can get properties of the TextBox control(s) using...
foreach (Control ctl in parent.Controls) ...and I can use those properties
to build the HTML label control but I don't know how to output and
render the HTML label control so it will precede its respectively rendered
TextBox control in the HTML that is generated when the TextBox
Server Control is rendered ar run-time.
I hope this makes sense and somebody can comment as it is much more
effective to automate a page to validate and function as Section508
accessible
than to write each HTML label control manually.