Professional Web Applications Themes

newbie question, how do I put a " in my coding ... - ASP.NET General

Hi, a newbie question here, I got a label ... I want to have something like label.text = "<font color="#000000">test</font>" but it won't work since the " will end the statement ... please help, thanks ......

  1. #1

    Default newbie question, how do I put a " in my coding ...

    Hi,

    a newbie question here, I got a label ...
    I want to have something like label.text = "<font
    color="#000000">test</font>"

    but it won't work since the " will end the statement ...

    please help, thanks ...


    THY Guest

  2. #2

    Default Re: newbie question, how do I put a " in my coding ...

    single quote? or split into = "<font color=" + """" + "#000000" + """" +
    ">test</font>" etc.
    depends. or '"'


    "THY" <com> wrote in message
    news:%23RZMM$phx.gbl... 


    MS Guest

  3. #3

    Default Re: newbie question, how do I put a " in my coding ...

    I need to have more than 1 color in that label ...
    <font color="#ffffff">a<font><font color="#ffffff">b<font>




    "John Saunders" <com> wrote in message
    news:O%phx.gbl... 
    >
    > Just set label.Text = "test" and label.ForeColor = Color.Black.
    > --
    > John Saunders
    > Internet Engineer
    > com
    >
    >[/ref]


    THY Guest

  4. #4

    Default Re: newbie question, how do I put a " in my coding ...

    Well repeat the process
    "<font color=" + """" + "#ffffff" + """" + ">a</font><font color=" + """" +
    "#bbbb" + """" + ">b</font>"
    etc..

    "THY" <com> wrote in message
    news:phx.gbl... 
    > >
    > > Just set label.Text = "test" and label.ForeColor = Color.Black.
    > > --
    > > John Saunders
    > > Internet Engineer
    > > com
    > >
    > >[/ref]
    >
    >[/ref]


    MS Guest

  5. #5

    Default newbie question, how do I put a " in my coding ...

    I'm not sure if your main goal is to set the font of the
    text or not, but if it is that's not how you do it.

    You can either set it in the HTML when you make your label
    like:
    <asp:Label id="LabelID" runat="server" Font-
    Names="Verdana" Font-Size="Small" ForeColor="Black" />

    Or in the VB code like:
    LabelID.ForeColor = System.Drawing.Color.Red

    Then if you wanted to add your text it would be something
    like:
    LabelID.Text = "Hellow World!"

    But so far I've never needed to put a double-quote in a
    label, so I'm not really sure how to do that.. Maybe
    something like:

    LabelID.text = "<font color="""#000000""">text</font>"

    But I don't know...

    Hope this helps,
    Jeremy
     
    Jeremy Guest

  6. #6

    Default Re: newbie question, how do I put a " in my coding ...

    Sorry, didn't see the other replies when I posted my first
    reply. Guess I should have refreshed the page before I
    replied...

    Anyway, you could try placing all of the labels into a
    placeholder, set their colors independently and just worry
    about the text that goes in each of the labels you need.

    Jeremy
     
    color="#ffffff">b<font> 
    message [/ref][/ref]
    statement ... [/ref]
    Color.Black. 
    >
    >
    >.
    >[/ref]
    Jeremy Guest

  7. #7

    Default Re: newbie question, how do I put a " in my coding ...

    ah, this is cool ... thanks for it ...

    by the way, I found out you dont have to put the + ...
    just make it "" and it will auto become " on output ...

    thanks for it ... : )



    "MS News (MS ILM)" <com> wrote in message
    news:phx.gbl... 
    >
    >[/ref]


    THY Guest

  8. #8

    Default Re: newbie question, how do I put a " in my coding ...

    Good job


    "THY" <com> wrote in message
    news:%phx.gbl... 
    > >
    > >[/ref]
    >
    >[/ref]


    MS Guest

  9. #9

    Default Re: newbie question, how do I put a " in my coding ...

    In article <#RZMM$phx.gbl>, com
    says... 

    This might help:

    Label1.Text="<font color='"#00ce69"'>";
    Label1.Text="TEST!";
    Lable1.Text="</font>;

    Best,
    Jeery
    --
    http://www.toasty0.com
    Jerry Guest

  10. #10

    Default Re: newbie question, how do I put a " in my coding ...

    Ok (you didn't mention that!).

    But you shouldn't use <font>. Instead use <span
    style="color=#000000">x</span>. <font> is deprecated.
    --
    John Saunders
    Internet Engineer
    com

    "THY" <com> wrote in message
    news:phx.gbl... 
    > >
    > > Just set label.Text = "test" and label.ForeColor = Color.Black.
    > > --
    > > John Saunders
    > > Internet Engineer
    > > com
    > >
    > >[/ref]
    >
    >[/ref]


    John Guest

Similar Threads

  1. Newbie question: How can I create a "tiled" background?
    By michaaal in forum Macromedia Flash
    Replies: 2
    Last Post: April 2nd, 06:05 AM
  2. Replies: 10
    Last Post: November 17th, 11:34 AM
  3. Newbie Question - "trusted SQL Server connection"
    By Greg Smith in forum ASP.NET Security
    Replies: 1
    Last Post: August 20th, 06:43 PM
  4. Replies: 2
    Last Post: July 19th, 08:03 PM
  5. Replies: 0
    Last Post: January 9th, 06:19 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