Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2004
    Posts
    124

    Unanswered: adding CSS class to ASP line

    I would like to add a CSS class (.month) to the following ASP line:

    tmpHTML = tmpHTML & "<a href=""?EventDate=" &
    Server.URLEncode(DateAdd("m",-1, EventDate)) & """>&#171;</a>" &
    CurMonthName & "&#44;" & " "

    How would I place the class in the line? I tried the following, but it didn't work.

    tmpHTML = tmpHTML & "<a href=""?EventDate=" &
    Server.URLEncode(DateAdd("m",-1, EventDate)) & class=""month"" &
    """>&#171;</a>" & CurMonthName & "&#44;" & " "

    Thanks for any help.
    -D-

  2. #2
    Join Date
    May 2004
    Posts
    125
    try this:

    tmpHTML = tmpHTML & "<a href=""?EventDate=" &
    Server.URLEncode(DateAdd("m",-1, EventDate)) & "class=""month""" &
    """></a>" & CurMonthName & "," & " "

  3. #3
    Join Date
    Jan 2004
    Posts
    124
    Thanks for replying to my post. I modified the code as you suggested, which did stop the syntax error from being thrown.

    However, "class=" is being appended to the URL string with the rest of the querystring value instead of being recognized as a CSS class style within the page.

    Definately a step closer though.

    Here is the code as modified:
    tmpHTML = tmpHTML & "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",-1, EventDate)) & "class=""month""" & """>&#171;</a>" & CurMonthName & "&#44;" & " "

    Any ideas how to get it recognized as a CSS class style?
    Thanks for your help.
    -D-

  4. #4
    Join Date
    Jul 2003
    Location
    SoCal
    Posts
    721
    Try:

    tmpHTML = tmpHTML & "<a href=""?EventDate=" & Server.URLEncode(DateAdd("m",-1, EventDate)) & """ class=""month""" & "></a>" & CurMonthName & ", "
    That which does not kill me postpones the inevitable.

Posting Permissions

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