Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Simple attribute question (I hope)

Reply
Thread Tools

Simple attribute question (I hope)

 
 
Bryan Glennon
Guest
Posts: n/a
 
      11-12-2003
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
 
Reply With Quote
 
 
 
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-13-2003
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.

 
Reply With Quote
 
 
 
 
Bryan Glennon
Guest
Posts: n/a
 
      11-13-2003
In article <(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> 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
 
Reply With Quote
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-14-2003
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.

 
Reply With Quote
 
Bryan Glennon
Guest
Posts: n/a
 
      11-14-2003
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, 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.
>
>.
>

 
Reply With Quote
 
Jacob Yang [MSFT]
Guest
Posts: n/a
 
      11-17-2003
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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation (XHTML 1.0 Transitional): Attribute 'leftmargin' is not a valid attribute of element 'body'. anonymous ASP .Net 1 08-02-2006 08:05 AM
picking value of one attribute based on a child elements attribute? XPath? vjethava@gmail.com XML 2 03-06-2006 05:19 AM
Implied instance attribute creation when referencing a class attribute Russell Warren Python 5 01-17-2006 05:07 AM
XSLT: Making attribute to parent attribute Bostonasian XML 1 09-18-2005 07:30 AM
class attribute to instance attribute Donnal Walter Python 4 07-06-2005 04:35 AM



Advertisments