views:

573

answers:

3

For example currently, the value is set with lblAmount.Text = Amount & " €"

How can i add (dynamically) superscript to the sign?

+1  A: 

use the SUP tag.

lblAmount.Text = Amount & "<sup>€</sup>"
Stephen Wrighton
A: 

You do this best by adding either a style attribute or by adding a class (and adding the style in a style tag or a css file.

<asp:Label id="lblAmount" runat="server"></asp:Label><asp:Label id="lblAmountSymbol" runat="server" CssClass="yourclass"></asp:Label>

span.yourclass {
    font-size:9px; 
    vertical-align:top; 
}

or

<asp:Label id="lblAmount" runat="server"></asp:Label><asp:Label id="lblAmountSymbol" runat="server"></asp:Label>

and this, in your code file

Me. lblAmount.Style.Add(HtmlTextWriterStyle.FontSize, "9px")
Me. lblAmount.Style.Add(HtmlTextWriterStyle.VerticalAlign, "top")

You could also use the html equivalent sup:

Me. lblAmount.Text = Amount & " <sup>€</sup>"
Gabriel McAdams
A: 
Goto Start->Programs->Accessories->System tools->Character Map
Now select this Character ² from the Characters listed.
Click Select
Click Copy

Then try to change the text of any control by pasting this Character in the Lable or Button Caption at Properties.

Even you can wrting code also like this:
Code\Button1.Text = "mm ²"\Code

This is working fine with me.
Ashish