showing literal text as I want it ...

K

Koen Hoorelbeke

Hi there,

I want to display a euro-sign in some of my pages (in Labels, but also in f.e. an Object List). Since this is a IMode application, those characters have only one way of showing them across the various browsers and handsets: in my resulting html it should be there as : € ( & # 8 3 6 4 ; )

a.. If I do : lblTest.Text = "€" , the resulting html returns : € , which actually shows as the string I entered, and not the euro-sign I wanted to see.
b.. If I do : lblTest.Text = HttpUtility.HtmlDecode("€"); , the resulting html returns : â,¬ (some encoded character), where I would expected this would have been € (in this case the character shows correct on only a few handsets, not on all)
c.. If I do : Response.Write("€") , the resulting html returns as "€", which is as it should be, but it 's in the response.write, which I can't use to set the text of a label or any other attribute from f.e. an ObjectList.
How can this be done ? Is there some kind of equivalent to the HttpUtility, but then for mobile pages ?

Thanks in advance!!!

Greetingz,
Koen Hoorelbeke.
 
E

Earl Beaman[MS]

Hi Koen,

Unfortunately, all the text properties of both mobile and non-mobile text
controls(label, textbox, etc) are HTML encoded. Thus, entity references
such as this will not work.
Have you tried to change your culture and format the string?

Here's a small code example:

using System.Threading;
using System.Globalization;

private void Page_Load(object sender, System.EventArgs e)
{
CultureInfo ci =new CultureInfo("nl-NL");
double MyDouble = 123456789;
//"c" is for currency
Response.Write(MyDouble.ToString("c"));
}

Let me know if this helps.

Thanks,
Earl Beaman
Internet Development Support
Visual InterDev/ASP Scripting/ASP.NET/MMIT
Microsoft Corp.
Email: (e-mail address removed)
Voice: (425) 704-4180

Satisfied customers are our top priority. We are interested in any
feedback you might have about the service you received on this incident.
You can contact me or reach my manager, Jeremy Chapman, at:
mailto:[email protected]?subject=DSASPNET_Feedback&body=Jeremy%20Chapma
n. If you don't use the enclosed mailto, make sure the keyword
DSMINT_Feedback is in the title or body of messages sent to
(e-mail address removed). This will assure your message is routed quickly
and accurately.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top