showing literal text as I want it ...

Discussion in 'ASP .Net Mobile' started by Koen Hoorelbeke, Nov 19, 2003.

  1. 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.
     
    Koen Hoorelbeke, Nov 19, 2003
    #1
    1. Advertising

  2. 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:
    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:?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
    . This will assure your message is routed quickly
    and accurately.
     
    Earl Beaman[MS], Nov 21, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ray Booysen
    Replies:
    2
    Views:
    648
    Ray Booysen
    Mar 28, 2006
  2. Anonieko Ramos

    What's wrong with rpc-literal? Why use doc-literal?

    Anonieko Ramos, Sep 27, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    380
    Anonieko Ramos
    Sep 27, 2004
  3. techy techno
    Replies:
    3
    Views:
    152
    Roland Hall
    Jan 15, 2004
  4. Replies:
    4
    Views:
    159
    Ted Zlatanov
    Sep 13, 2006
  5. pavi
    Replies:
    0
    Views:
    1,341
Loading...

Share This Page