M
Martman
First here is my goal:
When a datalist is rendered to a page and you use the <itemtemplate> the
datalist automatically prints a <tr> <td> start and end tags. Now this
may not be too bad but I have run into a situation repeatedly with the
designing factor of a datalist.
Most of the time when I use a datalist I utilize the header, item, and
footer templates to build a custom table. However, utilizing the simple
example below you will see why this is a problem.
My datalist in code:
<headertemplate>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</headertemplate>
<itemtemplate>
<tr>
<td scope="row"></td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
I have to build Section 508 compliant web pages for handicap
accessibility which .Net does not do very well. Now with the above
DataList the actual output would be like the following:
<table id="dlstMyDataList_skdis">
<tr>
<td>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</td>
</tr>
<tr>
<td>
<tr>
<td scope="row"></td>
</tr>
</td>
</tr>
</table>
</table>
As you can see this is not a very well formed table and can cause
enormous problems with page layouts and 508 issues. Is there any way I
can override the way that .Net outputs the DataList object so that I can
effectively have a correctly designed table?
Thanks
Marty U
When a datalist is rendered to a page and you use the <itemtemplate> the
datalist automatically prints a <tr> <td> start and end tags. Now this
may not be too bad but I have run into a situation repeatedly with the
designing factor of a datalist.
Most of the time when I use a datalist I utilize the header, item, and
footer templates to build a custom table. However, utilizing the simple
example below you will see why this is a problem.
My datalist in code:
<headertemplate>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</headertemplate>
<itemtemplate>
<tr>
<td scope="row"></td>
</tr>
</itemtemplate>
<footertemplate>
</table>
</footertemplate>
I have to build Section 508 compliant web pages for handicap
accessibility which .Net does not do very well. Now with the above
DataList the actual output would be like the following:
<table id="dlstMyDataList_skdis">
<tr>
<td>
<table width="100%" summary="Table displays a list of info">
<tr>
<th scope="col"></th>
<tr>
</td>
</tr>
<tr>
<td>
<tr>
<td scope="row"></td>
</tr>
</td>
</tr>
</table>
</table>
As you can see this is not a very well formed table and can cause
enormous problems with page layouts and 508 issues. Is there any way I
can override the way that .Net outputs the DataList object so that I can
effectively have a correctly designed table?
Thanks
Marty U