473,503 Members | 939 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change the Class of a table

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!
Feb 15 '07 #1
2 1099
In article <#U**************@TK2MSFTNGP06.phx.gbl>, clofts@shepherd-
neame.co.uk says...
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.

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 16 '07 #2
I will give that a try.

Thanks for the suggestion Patrick.

Corinne
"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <#U**************@TK2MSFTNGP06.phx.gbl>, clofts@shepherd-
neame.co.uk says...
>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.

--
Patrick Steele
http://weblogs.asp.net/psteele

Feb 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5293
by: Matt | last post by:
When the user resize the browser, the "Frequently Used Link" and "Table 1" and "Table 2" will shift to the left hand side, but table position is unchanged. I really have no idea how to fix that. I...
2
6146
by: Pete Kipe | last post by:
I'm not a JavaScript programmer...but I'm trying to put together a simple menu system for a new website and need a little help. I have the following script: <SCRIPT language=javascript> <!--...
4
12717
by: Alexandre Jaquet | last post by:
Hi, I would like to know how can I change a row background color when an user select a row thx
2
1161
by: sam | last post by:
Hello Group, I have a table which consists of few web datagrids. Based on certain condition, I want to change the table bgcolor from the code behind. Any help would be great!! Thanks, Sam.
16
2003
by: Giggle Girl | last post by:
Hi there, I have a nav tree similar to the XP Windows Explorer in behavior. It uses styles to underline a row on mouseover, and change the look of a row when clicked. Currently, it is working...
1
6750
by: sueian | last post by:
can some1 help with this code. can i add in a function like on click. when user click one of the link. the color will change to static from mouse over color. the text need to highligted after click....
10
3558
by: apparker | last post by:
I'm creating a new GUI for a program and it is for a medical exam. There are so many different things to ask someone during a history it wastes too much space to make checkboxes for everything so I...
1
2665
by: rockdale | last post by:
Hi, all I am change my webpage to using div and css for my layout, it was using table before and I want to get rid of it. Basically it draws a box around my content using background pictures,...
5
4436
by: thatcollegeguy | last post by:
Below are my 3php and 2js files. I create a table using ajax/php and then want to change the values in the tables add(+ number for teamid) id's for each specific td in the table. I don't know...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.