Professional Web Applications Themes

Need Help With Syntax! - ASP Database

> <td bgcolor="#FFFFFF" width="10"> > > How do I get the double quotes to appear when using a variable for the > color and width. Why do you need the double quotes to appear??? Double-quotes around attribute values are useless, imho, unless the value has spaces. They certainly shouldn't be used when the value is numeric, such as width="10" .... all you're doing is adding two characters to the weight of the page, every time you have such a value. Anyway, see [url]http://www.aspfaq.com/2065[/url]...

  1. #1

    Default Re: Need Help With Syntax!

    > <td bgcolor="#FFFFFF" width="10">
    >
    > How do I get the double quotes to appear when using a variable for the
    > color and width.
    Why do you need the double quotes to appear??? Double-quotes around
    attribute values are useless, imho, unless the value has spaces. They
    certainly shouldn't be used when the value is numeric, such as width="10"
    .... all you're doing is adding two characters to the weight of the page,
    every time you have such a value.

    Anyway, see [url]http://www.aspfaq.com/2065[/url]


    Aaron Bertrand - MVP Guest

  2. #2

    Default Re: Need Help With Syntax!

    Response.Write("<td bgcolor=""" & strBgColorBckGrnd & """ width=""" &
    Len(x.Value) & """>")


    --
    Mark Schupp
    --
    Head of Development
    Integrity eLearning
    Online Learning Solutions Provider
    [email]mschuppielearning.com[/email]
    [url]http://www.ielearning.com[/url]
    714.637.9480 x17


    "zmaerd" <zmaerdbellsouth.net> wrote in message
    news:1c254f62.0308060812.69671b4posting.google.co m...
    > I'm trying to get the following:
    >
    > Response.Write("<td bgcolor=" & strBgColorBckGrnd & " width=" &
    > Len(x.Value) & ">")
    >
    > To look like this in the browser:
    >
    > <td bgcolor="#FFFFFF" width="10">
    >
    > How do I get the double quotes to appear when using a variable for the
    > color and width.
    >
    >
    > The above produces:
    > <td bgcolor=FFFFFF width=10>
    >
    > Any ideas .asp pros?
    > Thanks in advance!

    Mark Schupp Guest

  3. #3

    Default Re: Need Help With Syntax!

    Aaron, see here. [url]http://www.w3.org/TR/xhtml1/#h-4.4[/url]

    Ray at work

    "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    news:uewQBkDXDHA.1680tk2msftngp13.phx.gbl...
    > Why do you need the double quotes to appear??? Double-quotes around
    > attribute values are useless, imho, unless the value has spaces. They
    > certainly shouldn't be used when the value is numeric, such as width="10"
    > ... all you're doing is adding two characters to the weight of the page,
    > every time you have such a value.
    >

    Ray at Guest

  4. #4

    Default Re: Need Help With Syntax!

    Well, my question wasn't, "is there some standards body that has written
    some specification that 'recommends' that all attribute values must be
    quoted?"

    Rather, I was curious why this specific person needs to have attribute
    values quoted. Since the browsers don't care, and in most cases it serves
    only to make the page weigh more...

    I understand the value of having standards, but I also understand the value
    of not being required to follow every single line... we'd spend more time
    reading the damn spec, and adding weight to our pages, than actually working
    on the code...




    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:OznxtoDXDHA.1748TK2MSFTNGP12.phx.gbl...
    > Aaron, see here. [url]http://www.w3.org/TR/xhtml1/#h-4.4[/url]
    >
    > Ray at work
    >
    > "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    > news:uewQBkDXDHA.1680tk2msftngp13.phx.gbl...
    >
    > > Why do you need the double quotes to appear??? Double-quotes around
    > > attribute values are useless, imho, unless the value has spaces. They
    > > certainly shouldn't be used when the value is numeric, such as
    width="10"
    > > ... all you're doing is adding two characters to the weight of the page,
    > > every time you have such a value.
    > >
    >
    >

    Aaron Bertrand - MVP Guest

  5. #5

    Default Re: Need Help With Syntax!

    To each his own. I'll stick with following standards.

    Ray at work

    "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    news:eA8yEuDXDHA.2592TK2MSFTNGP09.phx.gbl...
    > Well, my question wasn't, "is there some standards body that has written
    > some specification that 'recommends' that all attribute values must be
    > quoted?"
    >
    > Rather, I was curious why this specific person needs to have attribute
    > values quoted. Since the browsers don't care, and in most cases it serves
    > only to make the page weigh more...
    >
    > I understand the value of having standards, but I also understand the
    value
    > of not being required to follow every single line... we'd spend more time
    > reading the damn spec, and adding weight to our pages, than actually
    working
    > on the code...
    >
    >
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:OznxtoDXDHA.1748TK2MSFTNGP12.phx.gbl...
    > > Aaron, see here. [url]http://www.w3.org/TR/xhtml1/#h-4.4[/url]
    > >
    > > Ray at work
    > >
    > > "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    > > news:uewQBkDXDHA.1680tk2msftngp13.phx.gbl...
    > >
    > > > Why do you need the double quotes to appear??? Double-quotes around
    > > > attribute values are useless, imho, unless the value has spaces. They
    > > > certainly shouldn't be used when the value is numeric, such as
    > width="10"
    > > > ... all you're doing is adding two characters to the weight of the
    page,
    > > > every time you have such a value.
    > > >
    > >
    > >
    >
    >

    Ray at Guest

  6. #6

    Default Re: Need Help With Syntax!

    > To each his own. I'll stick with following standards.

    Again, I didn't say I was opposed to following standards. I just think
    there are some standards that make sense to follow, and others that don't.

    Do you really, honestly follow every single "standard" on that page, every
    time you code up an HTML page? Do you check the standard every time you
    start a page, just in case it has changed since last time? Are you going to
    change your coding style (and even go back and alter existing code) every
    time W3C makes a change to that page? Or whenever any new organization
    decides to publish standards? What happens when two different bodies post
    "standards" that conflict (e.g. coding conventions at your workplace vs. W3C
    recommendations)?

    Also note that I intentionally highlighted the word "recommends" in my
    previous e-mail. After all, you pointed me to a recommendation for the
    XHTML standard, not an existing and accepted HTML standard. So, the answer
    to the original question I posed may very well have been, "yes, I am
    creating XHTML doents that must conform to the W3C recommendation." But
    likely not.


    Aaron Bertrand - MVP Guest

  7. #7

    Default Re: Need Help With Syntax!

    the simplest way is(unless this is a part of vbscript function) is end the
    <% %> tags before you write html
    like

    %>
    <td bgcolor="<%=strBgColorBckGrnd %> width=" <%=Len(x.Value) %>">
    <%
    carry on with ur rest of the asp script
    %>

    i personally dont like writing the html tags using response.write......this
    is just personal statement...no standards attached ;-)

    Vivek




    "zmaerd" <zmaerdbellsouth.net> wrote in message
    news:1c254f62.0308060812.69671b4posting.google.co m...
    > I'm trying to get the following:
    >
    > Response.Write("<td bgcolor=" & strBgColorBckGrnd & " width=" &
    > Len(x.Value) & ">")
    >
    > To look like this in the browser:
    >
    > <td bgcolor="#FFFFFF" width="10">
    >
    > How do I get the double quotes to appear when using a variable for the
    > color and width.
    >
    >
    > The above produces:
    > <td bgcolor=FFFFFF width=10>
    >
    > Any ideas .asp pros?
    > Thanks in advance!

    vivek Guest

  8. #8

    Default Re: Need Help With Syntax!


    "Aaron Bertrand - MVP" <aaronTRASHaspfaq.com> wrote in message
    news:eW%23PV1DXDHA.1640TK2MSFTNGP10.phx.gbl...
    > > To each his own. I'll stick with following standards.
    >
    > Again, I didn't say I was opposed to following standards. I just think
    > there are some standards that make sense to follow, and others that don't.
    >
    > Do you really, honestly follow every single "standard" on that page, every
    > time you code up an HTML page?
    No, I still can't bring myself to use lowercase tags. I hate lowercase
    tags.

    Do you check the standard every time you
    > start a page, just in case it has changed since last time? Are you going
    to
    > change your coding style (and even go back and alter existing code) every
    > time W3C makes a change to that page?
    Yes. (That's a lie.)


    It's fine. I just wanted to make sure that you and the OP were aware so
    that y'all can decide accordingly. Not to mention it's fun to contradict
    you and possibly be right, because it is a rare opportunity. :P

    Ray at work


    Ray at Guest

  9. #9

    Default Re: Need Help With Syntax!

    > It's fine. I just wanted to make sure that you and the OP were aware so
    > that y'all can decide accordingly. Not to mention it's fun to contradict
    > you and possibly be right, because it is a rare opportunity. :P
    Well, in cases like this, I think it's completely subjective. But I'm still
    right, so nya-nya! :-p


    Aaron Bertrand - MVP Guest

  10. #10

    Default Re: Need Help With Syntax!

    Seems the thread here got way off the topic....

    Anyways, I would just do this

    Response.Write("<td bgcolor=" & Chr(34) & strBgColorBckGrnd & Chr(34) & "
    width=" & Chr(34) & Len(x.Value) & Chr(34) & ">")

    Maybe this is easiest.
    Jim


    "zmaerd" <zmaerdbellsouth.net> wrote in message
    news:1c254f62.0308060812.69671b4posting.google.co m...
    > I'm trying to get the following:
    >
    > Response.Write("<td bgcolor=" & strBgColorBckGrnd & " width=" &
    > Len(x.Value) & ">")
    >
    > To look like this in the browser:
    >
    > <td bgcolor="#FFFFFF" width="10">
    >
    > How do I get the double quotes to appear when using a variable for the
    > color and width.
    >
    >
    > The above produces:
    > <td bgcolor=FFFFFF width=10>
    >
    > Any ideas .asp pros?
    > Thanks in advance!

    Jim Plante Guest

  11. #11

    Default Re: Need Help With Syntax!

    Arrghh, why didn't I think of that!?!?! I feel like a big dummy. :)

    Thanks for your help!

    "vivek" <vivsandela> wrote in message news:<8FaYa.246397$BA.59641025twister.columbus.rr .com>...
    > the simplest way is(unless this is a part of vbscript function) is end the
    > <% %> tags before you write html
    > like
    >
    > %>
    > <td bgcolor="<%=strBgColorBckGrnd %> width=" <%=Len(x.Value) %>">
    > <%
    > carry on with ur rest of the asp script
    > %>
    >
    > i personally dont like writing the html tags using response.write......this
    > is just personal statement...no standards attached ;-)
    >
    > Vivek
    >
    >
    >
    >
    > "zmaerd" <zmaerdbellsouth.net> wrote in message
    > news:1c254f62.0308060812.69671b4posting.google.co m...
    > > I'm trying to get the following:
    > >
    > > Response.Write("<td bgcolor=" & strBgColorBckGrnd & " width=" &
    > > Len(x.Value) & ">")
    > >
    > > To look like this in the browser:
    > >
    > > <td bgcolor="#FFFFFF" width="10">
    > >
    > > How do I get the double quotes to appear when using a variable for the
    > > color and width.
    > >
    > >
    > > The above produces:
    > > <td bgcolor=FFFFFF width=10>
    > >
    > > Any ideas .asp pros?
    > > Thanks in advance!
    zmaerd Guest

Similar Threads

  1. if/else tag syntax
    By negttid in forum Macromedia Flex General Discussion
    Replies: 8
    Last Post: March 20th, 02:15 AM
  2. Help with SYntax, Please!
    By Artspan in forum Macromedia ColdFusion
    Replies: 3
    Last Post: April 15th, 06:23 PM
  3. Syntax again - Help!
    By Geoff in forum Macromedia Flash Sitedesign
    Replies: 4
    Last Post: November 18th, 11:23 PM
  4. Syntax
    By yma in forum ASP.NET General
    Replies: 1
    Last Post: July 3rd, 02:00 PM
  5. Help with DB2 Syntax.
    By sharads in forum IBM DB2
    Replies: 1
    Last Post: July 3rd, 09:04 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139