Drop List.Text to include  

Discussion in 'ASP .Net' started by Tim, Apr 19, 2005.

  1. Tim

    Tim Guest

    Hi,

    I am trying to load up a drop list with semi aligned columns like so:

    [Item 1 Something]
    Item 2 Something Else

    etc.

    To do so, I have tried to fill the Text valus of ListItems like so:

    dim li as new ListItem

    li.Text = "Item 1" & StrDup(14, " ") & "Something"

    along with variations using encoding....

    However, in the web browser, the & is being replaced with &

    Any ideas please?

    - Tim
     
    Tim, Apr 19, 2005
    #1
    1. Advertising

  2. Tim

    Scott M. Guest

    Try this:

    li.Text = Server.HTMLEncode("Item 1 Something")


    "Tim" <Tim@NoSpam> wrote in message
    news:...
    > Hi,
    >
    > I am trying to load up a drop list with semi aligned columns like so:
    >
    > [Item 1 Something]
    > Item 2 Something Else
    >
    > etc.
    >
    > To do so, I have tried to fill the Text valus of ListItems like so:
    >
    > dim li as new ListItem
    >
    > li.Text = "Item 1" & StrDup(14, "&nbsp;") & "Something"
    >
    > along with variations using encoding....
    >
    > However, in the web browser, the & is being replaced with &amp;
    >
    > Any ideas please?
    >
    > - Tim
    >
    >
    >
     
    Scott M., Apr 19, 2005
    #2
    1. Advertising

  3. Tim

    Tim Guest

    Thanks Scott, but unfortunately this isn't working.
    This in code:
    Server.HTMLEncode("Item 1 Something")
    yields this in the web browser html source
    "Item 1 Something"
    which appears as
    "Item 1 Something"

    - the multiple spaces just "compress". I don't seem to be able to get the
    necessary &nbsp; sequences going through.

    There is an error in my post below I say strdup(n, "&nbsp;") when it should
    be MyDup(n, "&nbsp; ")
    - MyDup duplicates the string sequence, StrDup seems only to duplicate the
    first character.

    So, I am no closer...

    - Tim




    "Scott M." <> wrote in message
    news:...
    > Try this:
    >
    > li.Text = Server.HTMLEncode("Item 1 Something")
    >
    >
    > "Tim" <Tim@NoSpam> wrote in message
    > news:...
    >> Hi,
    >>
    >> I am trying to load up a drop list with semi aligned columns like so:
    >>
    >> [Item 1 Something]
    >> Item 2 Something Else
    >>
    >> etc.
    >>
    >> To do so, I have tried to fill the Text valus of ListItems like so:
    >>
    >> dim li as new ListItem
    >>
    >> li.Text = "Item 1" & StrDup(14, "&nbsp;") & "Something"
    >>
    >> along with variations using encoding....
    >>
    >> However, in the web browser, the & is being replaced with &amp;
    >>
    >> Any ideas please?
    >>
    >> - Tim
    >>
    >>
    >>

    >
    >
     
    Tim, Apr 19, 2005
    #3
  4. Tim

    Scott M. Guest

    Oops! Change "Encode" to "Decode".


    "Tim" <Tim@NoSpam> wrote in message
    news:...
    > Thanks Scott, but unfortunately this isn't working.
    > This in code:
    > Server.HTMLEncode("Item 1 Something")
    > yields this in the web browser html source
    > "Item 1 Something"
    > which appears as
    > "Item 1 Something"
    >
    > - the multiple spaces just "compress". I don't seem to be able to get the
    > necessary &nbsp; sequences going through.
    >
    > There is an error in my post below I say strdup(n, "&nbsp;") when it
    > should be MyDup(n, "&nbsp; ")
    > - MyDup duplicates the string sequence, StrDup seems only to duplicate the
    > first character.
    >
    > So, I am no closer...
    >
    > - Tim
    >
    >
    >
    >
    > "Scott M." <> wrote in message
    > news:...
    >> Try this:
    >>
    >> li.Text = Server.HTMLEncode("Item 1 Something")
    >>
    >>
    >> "Tim" <Tim@NoSpam> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> I am trying to load up a drop list with semi aligned columns like so:
    >>>
    >>> [Item 1 Something]
    >>> Item 2 Something Else
    >>>
    >>> etc.
    >>>
    >>> To do so, I have tried to fill the Text valus of ListItems like so:
    >>>
    >>> dim li as new ListItem
    >>>
    >>> li.Text = "Item 1" & StrDup(14, "&nbsp;") & "Something"
    >>>
    >>> along with variations using encoding....
    >>>
    >>> However, in the web browser, the & is being replaced with &amp;
    >>>
    >>> Any ideas please?
    >>>
    >>> - Tim
    >>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Scott M., Apr 19, 2005
    #4
  5. Tim

    Scott M. Guest

    No problem. Good luck.


    "Tim" <Tim@NoSpam> wrote in message
    news:...
    > Excellent! Thank you!
    >
    > - Tim
    >
    >
    > "Scott M." <> wrote in message
    > news:...
    >> Oops! Change "Encode" to "Decode".
    >>
    >>
    >> "Tim" <Tim@NoSpam> wrote in message
    >> news:...
    >>> Thanks Scott, but unfortunately this isn't working.
    >>> This in code:
    >>> Server.HTMLEncode("Item 1 Something")
    >>> yields this in the web browser html source
    >>> "Item 1 Something"
    >>> which appears as
    >>> "Item 1 Something"
    >>>
    >>> - the multiple spaces just "compress". I don't seem to be able to get
    >>> the necessary &nbsp; sequences going through.
    >>>
    >>> There is an error in my post below I say strdup(n, "&nbsp;") when it
    >>> should be MyDup(n, "&nbsp; ")
    >>> - MyDup duplicates the string sequence, StrDup seems only to duplicate
    >>> the first character.
    >>>
    >>> So, I am no closer...
    >>>
    >>> - Tim
    >>>
    >>>
    >>>
    >>>
    >>> "Scott M." <> wrote in message
    >>> news:...
    >>>> Try this:
    >>>>
    >>>> li.Text = Server.HTMLEncode("Item 1 Something")
    >>>>
    >>>>
    >>>> "Tim" <Tim@NoSpam> wrote in message
    >>>> news:...
    >>>>> Hi,
    >>>>>
    >>>>> I am trying to load up a drop list with semi aligned columns like so:
    >>>>>
    >>>>> [Item 1 Something]
    >>>>> Item 2 Something Else
    >>>>>
    >>>>> etc.
    >>>>>
    >>>>> To do so, I have tried to fill the Text valus of ListItems like so:
    >>>>>
    >>>>> dim li as new ListItem
    >>>>>
    >>>>> li.Text = "Item 1" & StrDup(14, "&nbsp;") & "Something"
    >>>>>
    >>>>> along with variations using encoding....
    >>>>>
    >>>>> However, in the web browser, the & is being replaced with &amp;
    >>>>>
    >>>>> Any ideas please?
    >>>>>
    >>>>> - Tim
    >>>>>
    >>>>>
    >>>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Scott M., Apr 19, 2005
    #5
  6. Tim

    Tim Guest

    Excellent! Thank you!

    - Tim


    "Scott M." <> wrote in message
    news:...
    > Oops! Change "Encode" to "Decode".
    >
    >
    > "Tim" <Tim@NoSpam> wrote in message
    > news:...
    >> Thanks Scott, but unfortunately this isn't working.
    >> This in code:
    >> Server.HTMLEncode("Item 1 Something")
    >> yields this in the web browser html source
    >> "Item 1 Something"
    >> which appears as
    >> "Item 1 Something"
    >>
    >> - the multiple spaces just "compress". I don't seem to be able to get the
    >> necessary &nbsp; sequences going through.
    >>
    >> There is an error in my post below I say strdup(n, "&nbsp;") when it
    >> should be MyDup(n, "&nbsp; ")
    >> - MyDup duplicates the string sequence, StrDup seems only to duplicate
    >> the first character.
    >>
    >> So, I am no closer...
    >>
    >> - Tim
    >>
    >>
    >>
    >>
    >> "Scott M." <> wrote in message
    >> news:...
    >>> Try this:
    >>>
    >>> li.Text = Server.HTMLEncode("Item 1 Something")
    >>>
    >>>
    >>> "Tim" <Tim@NoSpam> wrote in message
    >>> news:...
    >>>> Hi,
    >>>>
    >>>> I am trying to load up a drop list with semi aligned columns like so:
    >>>>
    >>>> [Item 1 Something]
    >>>> Item 2 Something Else
    >>>>
    >>>> etc.
    >>>>
    >>>> To do so, I have tried to fill the Text valus of ListItems like so:
    >>>>
    >>>> dim li as new ListItem
    >>>>
    >>>> li.Text = "Item 1" & StrDup(14, "&nbsp;") & "Something"
    >>>>
    >>>> along with variations using encoding....
    >>>>
    >>>> However, in the web browser, the & is being replaced with &amp;
    >>>>
    >>>> Any ideas please?
    >>>>
    >>>> - Tim
    >>>>
    >>>>
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Tim, Apr 19, 2005
    #6
    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. Naveen K Kohli

    How to add "&nbsp;" to list item text

    Naveen K Kohli, Aug 12, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    7,942
    sirjohnwest
    Oct 5, 2007
  2. farmer
    Replies:
    2
    Views:
    1,219
  3. weiwei
    Replies:
    0
    Views:
    1,034
    weiwei
    Jan 5, 2007
  4. Naveen K Kohli

    How to add "&nbsp;" to list item text

    Naveen K Kohli, Aug 12, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    173
    Ravikanth[MVP]
    Aug 13, 2003
  5. hotkitty

    Parsing CSV and "&nbsp;&nbsp;"

    hotkitty, Oct 9, 2008, in forum: Perl Misc
    Replies:
    9
    Views:
    342
Loading...

Share This Page