> asp.net 2.0 using vwd
>
[quoted text clipped - 15 lines]
> didnt' solve the problem. Any ideas on how this can be done? I just need a
> red border around the cell under certain conditions.
In order to access the td as ASP.NET control it needs, in addition to an id
attribute, a runat="server" attribute. This makes it a HtmlTableCell.
You can not assign a style string directly since its an instance of
CssStyleCollection. This isn't a good approach anyway. A css class would
be better. The HtmlTableCell doesn't expose a CssClass attribute so you
need to add it via the Attributes collection.
The HtmlTableCell has a Width property so you can assign the 547px width to
that property.
Add the following mark up to your <head>:-
<style type="text/css">
td.highlight {border:1px solid red;}
</style>
Then your code becomes:-
If txtAlert.Text <> "" Then
tdTest.Attributes.Add("class", "highlight");
Else
tdTest.Attributes.Remove("class");
End If

Signature
Anthony Jones - MVP ASP/ASP.NET
Keith G Hicks - 20 Mar 2008 00:28 GMT
Thanks Anthony. That worked. But I had to do some more research because I
still was unable to access my table cell in code:
http://www.velocityreviews.com/forums/t372741-how-to-access-html-controls-fr
om-code-behind-.html (Imports
System.Web.UI.HtmlControls)
Works fine now.
Keith
> > asp.net 2.0 using vwd
> >
[quoted text clipped - 50 lines]
> --
> Anthony Jones - MVP ASP/ASP.NET
Show how you define tdAlert in the .aspx page.

Signature
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
> asp.net 2.0 using vwd
>
[quoted text clipped - 22 lines]
>
> Keith