Simple attribute question (I hope)

B

Bryan Glennon

I have a small web control to put a footer on my pages. In the aspx page
I define a table. I try to set the style attribute for a <td> element,
but studio complains and when I hover over the style keyword the tooltip
says "Could not find any attribute "style" of element "td." In spite of
this, it seems to work fine - the resultant HTML at the client has a
properly formatted <td> element with the style attribute. I wouldn't be
so worried except that if I save the aspx page from design view, VS
nicely removes the questionable style attribute. I also figure I must be
doing something wrong, or VS would not complain.

Any answers?

Thanks,
Bryan
 
J

Jacob Yang [MSFT]

Hi Bryan,

I am trying to reproduce the problem with a simple testing sample on my
side? Is it possible for you to tell me the detailed steps? I certainly
appreciate your time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bryan Glennon

Hi Bryan,

I am trying to reproduce the problem with a simple testing sample on my
side? Is it possible for you to tell me the detailed steps? I certainly
appreciate your time.

No problem. Here's the ascx file:

<%@ Control Language="c#" CodeBehind="Footer.ascx.cs"
AutoEventWireup="false" Inherits="Controls.Footer" %>

<table border='0' width='100%'>
<tr>
<td align="left" width="30%" style="COLOR: #787878;
BACKGROUND-COLOR: #000000">
<small>Copyright © 2003, BPG Consulting, Inc.
</small>
</td>
<td align="middle" width="40%">
<small><a href="www.bpgc.com/Feedback.aspx"
style="COLOR: #00cccc; BACKGROUND-COLOR: #000000">
Feedback</a></small>
</td>
<td align="right" width="30%" style="COLOR: #787878;
BACKGROUND-COLOR: #000000"><small><%= Text %></small></td>
</tr>
</table>


All the associated cs file does is set a value for the Text property
used in the last <td> element. In VS, the "style" attributes in the <td>
elements are underlined as incorrect. VS has removed these attributes
from my code, I think when I edit the page in design mode rather than
editing the HTML directly, but I can't say that for certain.

Is the above code valid?

Thanks,
Bryan
 
J

Jacob Yang [MSFT]

Hi Bryan,

Thank you for your update.

I have tried your code but I cannot reproduce your problem on my side.
Please tell me the version of your VS.NET and .NET Framework. I am using
VS.NET 2003. The followings are my testing steps:

1. Create a C# web application.

2. Add a user control - Footer to the project.

3. Add the following HTML code in the Footer.ascx file.
------------------------------------
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="Footer.ascx.cs" Inherits="TestStyle.Footer"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"%>
<table border='0' width='100%'>
<tr>
<td align="left" width="30%" style="COLOR: #787878; BACKGROUND-COLOR:
#000000">
<small>Copyright ?2003, BPG Consulting, Inc. </small>
</td>
<td align="center" width="40%">
<small><a href="www.bpgc.com/Feedback.aspx" style="COLOR: #00cccc;
BACKGROUND-COLOR: #000000">
Feedback</a></small>
</td>
<td align="right" width="30%" style="COLOR: #787878;BACKGROUND-COLOR:
#000000">
<small>
<%= Text %>
</small>
</td>
</tr>
</table>
------------------------------------

4. I do not see

the "style" attributes in the <td> elements are underlined as incorrect

If I have missed something, please feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
B

Bryan Glennon

Jacob -
Thanks for the reply. I'm using VS.NET 2002 - maybe
that's the problem...

Cheers,
Bryan
-----Original Message-----
Hi Bryan,

Thank you for your update.

I have tried your code but I cannot reproduce your problem on my side.
Please tell me the version of your VS.NET and .NET Framework. I am using
VS.NET 2003. The followings are my testing steps:

1. Create a C# web application.

2. Add a user control - Footer to the project.

3. Add the following HTML code in the Footer.ascx file.
------------------------------------
<%@ Control Language="c#" AutoEventWireup="false"
Codebehind="Footer.ascx.cs" Inherits="TestStyle.Footer"
TargetSchema="http://schemas.microsoft.com/intellisense/ie 5"%>
<table border='0' width='100%'>
<tr>
<td align="left" width="30%" style="COLOR: #787878; BACKGROUND-COLOR:
#000000">
<small>Copyright ?2003, BPG
Consulting said:
</td>
<td align="center" width="40%">
<small><a
href="www.bpgc.com/Feedback.aspx" style="COLOR: #00cccc;
BACKGROUND-COLOR: #000000">
Feedback said:
</td>
<td align="right" width="30%"
style="COLOR: #787878;BACKGROUND-COLOR:
 
J

Jacob Yang [MSFT]

Hi Bryan,

Thank you for your update.

I have tried my testing steps in VS.NET 2002 IDE but I got the same result.
Would you please try my testing steps on your side? I certainly appreciate
your time.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top