ASP Functions & Style Sheets

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default ASP Functions & Style Sheets

    Can anyone tell me if it's possible to attach style sheets to functions. <%
    Function answerTypeA(A) If A = 1 then A = 'Never' elseIf A = 2 then A =
    'Seldom' elseIf A = 3 then A = 'Sometimes' elseIf A = 4 then A = 'Often'
    elseIf A = 5 then A = 'Always' End If Response.Write A End Function What
    I''m trying to do is have a different colour for each option. Or is there
    another way to change the text colour?

    ericMorcombe Guest

  2. Similar Questions and Discussions

    1. External style sheets
      Well youd think this would be pretty straight forward but no matter what i do i dont get any changes in my app. I have tried defining the style...
    2. Lost style sheets
      Style sheets are not being seen by browsers when saved by DW. When I save a set of files with their external style sheet, browsers are not able to...
    3. Style Sheets and Transitions
      I am not sure this is an appropriate question here, but I am using CSS to basically change an element on the screen based on a "timer" I would like...
    4. Style Sheets
      Can anyone tell me what a good dreamweaver book is on learning CSS? What do's and don'ts can you advise me in? Kelly
    5. Using external style sheets
      You shouldn't have any trouble. What does the URL of the stylesheet link look like? -- HTH, Kevin Spencer ..Net Developer Microsoft MVP...
  3. #2

    Default Re: ASP Functions & Style Sheets

    As ASP code is executed before the page is rendered in the browser you can
    write you CSS dynamically. Simply place your IF statement where the color of
    the element is defined.


    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "ericMorcombe" <webforumsuser@macromedia.com> wrote in message
    news:d48jfk$kpo$1@forums.macromedia.com...
    > Can anyone tell me if it's possible to attach style sheets to functions.
    <%
    > Function answerTypeA(A) If A = 1 then A = 'Never' elseIf A = 2 then A =
    > 'Seldom' elseIf A = 3 then A = 'Sometimes' elseIf A = 4 then A = 'Often'
    > elseIf A = 5 then A = 'Always' End If Response.Write A End Function
    What
    > I''m trying to do is have a different colour for each option. Or is there
    > another way to change the text colour?
    >

    Paul Whitham TMM Guest

  4. #3

    Default Re: ASP Functions & Style Sheets

    Bit new at this Paul. Could you provide an example of code please?
    ericMorcombe Guest

  5. #4

    Default Re: ASP Functions & Style Sheets

    Try something like this to dynamically set a color based on a value stored
    in a database

    <!--
    ..style1 {
    font-family: Georgia, "Times New Roman", Times, serif;
    color: <%=recordset.fields.item("color").value%>;
    }
    -->

    --
    Regards

    Paul Whitham
    Macromedia Certified Professional for Dreamweaver MX2004
    Valleybiz Internet Design
    [url]www.valleybiz.net[/url]

    Team Macromedia Volunteer for Ultradev/Dreamweaver MX
    [url]www.macromedia.com/support/forums/team_macromedia[/url]

    "ericMorcombe" <webforumsuser@macromedia.com> wrote in message
    news:d4dmtg$4dp$1@forums.macromedia.com...
    > Bit new at this Paul. Could you provide an example of code please?

    Paul Whitham TMM Guest

Posting Permissions

  • You may not post new threads
  • You may 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