Avatar of piyushdabomb
piyushdabomb
 asked on

Setting Superscripts in the Page Title

Hi,

I'm trying to dynamically set the page title in my Page_Load procedure using the following line of code:

Page.Header.Title = "O² Design Center"

This should render to O^2 Design Center (The 2 should be superscripted). I noticed that when the page loads the first time, it successfully shows the 2 being superscripted, but when when the page refreshes, I get  "O² Design Center" without the 2 being superscripted (i.e. You can see the ampersand, hash, 1, 7, 8, and the semicolon)

Any idea why after a page refresh, the 2 doesn't stay superscripted?

Its wierd. Let me know your thoughts. Thanks.
.NET ProgrammingASP.NETVisual Basic.NET

Avatar of undefined
Last Comment
slhall4

8/22/2022 - Mon
JohnPatrickPhilip


In your HTML code, just use this format, this should take care of it.

O²







O²
 
I am typing the same, if this experts-exchange HTMl rendering makes it into Super Script.
 
O & #178;
 
remove the space in between & and #

Open in new window

ASKER CERTIFIED SOLUTION
abel

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
abel

> In your HTML code, just use this format, this should take care of it.

isn't that the same that the OP just showed? And I saw something about "dynamically" setting the page title.

Just tried it. It shows like the screenshot, even after a page refresh.

ScreenShot162.png
abel

I tried it now with

Page.Header.Title = "O² Design Center"

as well and checked it after refresh... For me at least it shows normal. Regardless a page refresh or a postback. Tested on IE7 and FF3. What versions of VS/IE/FF do you use?
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
piyushdabomb

ASKER
Try it with IE6. It doesn't work.

abel

> Try it with IE6. It doesn't work.

with your original code, I reckon... That's an old IE6 problem. Can you try the literal method? Does that work for you?

-- Abel --
slhall4

Try this

Page.Header.Title = "O" & chr(178) & " Design Center"
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.