server.HTMLEncode

Discussion in 'ASP General' started by abcd, Jun 8, 2005.

  1. abcd

    abcd Guest

    Simple but not working at this moment

    I have to fill the HTML select control....

    my values could be for example "test number 1"

    sample code,

    dim x
    Data = "test number 1"

    I am using

    <Select>
    <option value="<%Response.Write server.HTMLEncode(Data)%>"><%Response.Write
    server.HTMLEncode(Data)%></option>
    </Select>

    as a result I can not see the longer black space between 2 words....I guess
    HTMLEncode is not emitting &nbsp

    any solution

    thanks
     
    abcd, Jun 8, 2005
    #1
    1. Advertising

  2. abcd

    abcd Guest

    DO you mean drop down list doesn not display &nbsp;


    Curt_C [MVP] wrote:
    > Its because of the control you are using... its rendering the &nbsp;
    >
    >
    > "abcd" <> wrote in message
    > news:...
    >> Simple but not working at this moment
    >>
    >> I have to fill the HTML select control....
    >>
    >> my values could be for example "test number 1"
    >>
    >> sample code,
    >>
    >> dim x
    >> Data = "test number 1"
    >>
    >> I am using
    >>
    >> <Select>
    >> <option value="<%Response.Write
    >> server.HTMLEncode(Data)%>"><%Response.Write
    >> server.HTMLEncode(Data)%></option>
    >> </Select>
    >>
    >> as a result I can not see the longer black space between 2 words....I
    >> guess HTMLEncode is not emitting &nbsp
    >>
    >> any solution
    >>
    >> thanks
     
    abcd, Jun 8, 2005
    #2
    1. Advertising

  3. abcd

    Bob Lehmann Guest

    Server.HtmlEncode does not encode spaces. You will need to use the Replace
    function to change spaces to &nbsp;.

    Bob Lehmann

    "abcd" <> wrote in message
    news:...
    > DO you mean drop down list doesn not display &nbsp;
    >
    >
    > Curt_C [MVP] wrote:
    > > Its because of the control you are using... its rendering the &nbsp;
    > >
    > >
    > > "abcd" <> wrote in message
    > > news:...
    > >> Simple but not working at this moment
    > >>
    > >> I have to fill the HTML select control....
    > >>
    > >> my values could be for example "test number 1"
    > >>
    > >> sample code,
    > >>
    > >> dim x
    > >> Data = "test number 1"
    > >>
    > >> I am using
    > >>
    > >> <Select>
    > >> <option value="<%Response.Write
    > >> server.HTMLEncode(Data)%>"><%Response.Write
    > >> server.HTMLEncode(Data)%></option>
    > >> </Select>
    > >>
    > >> as a result I can not see the longer black space between 2 words....I
    > >> guess HTMLEncode is not emitting &nbsp
    > >>
    > >> any solution
    > >>
    > >> thanks

    >
    >
     
    Bob Lehmann, Jun 9, 2005
    #3
    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. Makarand
    Replies:
    0
    Views:
    993
    Makarand
    Nov 6, 2003
  2. Andrea Williams

    Problem with C# Class and Server.HTMLEncode

    Andrea Williams, Jan 27, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    22,241
    Michael Earls
    Jan 27, 2004
  3. Michael Gaillez

    Server.HTMLEncode and performance

    Michael Gaillez, Jun 24, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,062
    Kevin Spencer
    Jun 24, 2004
  4. Replies:
    7
    Views:
    585
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    Jul 4, 2007
  5. MyndPhlyp
    Replies:
    3
    Views:
    494
    MyndPhlyp
    Oct 3, 2005
Loading...

Share This Page