Simple attribute question (I hope)

Discussion in 'ASP .Net Web Controls' started by Bryan Glennon, Nov 12, 2003.

  1. 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
     
    Bryan Glennon, Nov 12, 2003
    #1
    1. Advertising

  2. 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.
     
    Jacob Yang [MSFT], Nov 13, 2003
    #2
    1. Advertising

  3. In article <>,
    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
     
    Bryan Glennon, Nov 13, 2003
    #3
  4. 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.
     
    Jacob Yang [MSFT], Nov 14, 2003
    #4
  5. 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.
    >
    >.
    >
     
    Bryan Glennon, Nov 14, 2003
    #5
  6. 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.
     
    Jacob Yang [MSFT], Nov 17, 2003
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. me2u
    Replies:
    2
    Views:
    284
    Saravana [MVP]
    Oct 31, 2003
  2. Shane
    Replies:
    4
    Views:
    344
    Shane
    Jul 20, 2004
  3. John Doe
    Replies:
    7
    Views:
    329
    Daniel Pitts
    Nov 19, 2006
  4. Rob

    simple question (I hope!)

    Rob, Jan 5, 2007, in forum: HTML
    Replies:
    10
    Views:
    545
    dorayme
    Jan 8, 2007
  5. Adrian

    Simple question I hope!

    Adrian, Sep 19, 2003, in forum: Javascript
    Replies:
    9
    Views:
    137
    Adrian
    Sep 21, 2003
Loading...

Share This Page