How to change the Class of a table

  • Thread starter Thread starter Corinne
  • Start date Start date
C

Corinne

Hi All,

I have a table in a aspx page.

I want to change the class value dependign on a value pass to the page.

Any idea how I get to do that.

I would have expected the following to work but it doesn't. For some reason
I get "Name "Value" is not declared"

<%
dim value as string
value = "classname"
%>
.....

<table class="<%=value%>">
<tr><td>&nbsp;</td></tr>
</table>


Any help would be apreciated

Corinne

Ta!
 
clofts@shepherd- said:
Hi All,

I have a table in a aspx page.

I want to change the class value dependign on a value pass to the page.

Any idea how I get to do that.

I would have expected the following to work but it doesn't. For some reason
I get "Name "Value" is not declared"

<%
dim value as string
value = "classname"
%>
....

<table class="<%=value%>">
<tr><td>&nbsp;</td></tr>
</table>


Any help would be apreciated

Corinne

I would use the server-side control <asp:Table>. Then you can just set
that control's "CssClass" property during PageLoad.
 
Back
Top