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

  • Thread starter Thread starter THY
  • Start date Start date
T

THY

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 ...
 
single quote? or split into = "<font color=" + """" + "#000000" + """" +
">test</font>" etc.
depends. or '"'
 
I need to have more than 1 color in that label ...
<font color="#ffffff">a<font><font color="#ffffff">b<font>
 
Well repeat the process
"<font color=" + """" + "#ffffff" + """" + ">a</font><font color=" + """" +
"#bbbb" + """" + ">b</font>"
etc..
 
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
 
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
 
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 ... : )
 
Good job


THY said:
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 ... : )
 
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 ...

This might help:

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

Best,
Jeery
 
Ok (you didn't mention that!).

But you shouldn't use <font>. Instead use <span
style="color=#000000">x</span>. <font> is deprecated.
 
Back
Top