HtmlEncode in <asp:image>

Discussion in 'ASP .Net' started by MRW, Sep 30, 2006.

  1. MRW

    MRW Guest

    Hello!

    I'm taking a file name from a database and using the <asp:image> tag in
    GridView to show the image. However, some of the file names have
    spaces in it and no matter what I do, for example:

    <asp:Image runat=server ImageUrl=<%#
    HttpUtility.HtmlDecode((Eval("WallpaperLink"))) %> />

    It still displays the file as: bobs%20image. %20 keeps popping up.
    Does anybody have any solutions? Oh yes, I've also tried
    URLDecode/Encode

    Thanks for the help!
    MRW, Sep 30, 2006
    #1
    1. Advertising

  2. I answered this in some other newsgroup where you also posted it. Use
    crossposting instead of posting separate copies.

    MRW wrote:
    > Hello!
    >
    > I'm taking a file name from a database and using the <asp:image> tag in
    > GridView to show the image. However, some of the file names have
    > spaces in it and no matter what I do, for example:
    >
    > <asp:Image runat=server ImageUrl=<%#
    > HttpUtility.HtmlDecode((Eval("WallpaperLink"))) %> />
    >
    > It still displays the file as: bobs%20image. %20 keeps popping up.
    > Does anybody have any solutions? Oh yes, I've also tried
    > URLDecode/Encode
    >
    > Thanks for the help!
    >
    =?ISO-8859-1?Q?G=F6ran_Andersson?=, Sep 30, 2006
    #2
    1. Advertising

  3. MRW

    MRW Guest

    I'll be honest... this is the only newsgroup I posted to...

    Göran Andersson wrote:
    > I answered this in some other newsgroup where you also posted it. Use
    > crossposting instead of posting separate copies.
    >
    > MRW wrote:
    > > Hello!
    > >
    > > I'm taking a file name from a database and using the <asp:image> tag in
    > > GridView to show the image. However, some of the file names have
    > > spaces in it and no matter what I do, for example:
    > >
    > > <asp:Image runat=server ImageUrl=<%#
    > > HttpUtility.HtmlDecode((Eval("WallpaperLink"))) %> />
    > >
    > > It still displays the file as: bobs%20image. %20 keeps popping up.
    > > Does anybody have any solutions? Oh yes, I've also tried
    > > URLDecode/Encode
    > >
    > > Thanks for the help!
    > >
    MRW, Sep 30, 2006
    #3
  4. MRW

    MRW Guest

    My apologies... when I originally posted my question, I did not see it
    posted. Thinking an error occured, I tried again. I now see that it
    DID post correctly....

    Göran Andersson wrote:
    > I answered this in some other newsgroup where you also posted it. Use
    > crossposting instead of posting separate copies.
    >
    > MRW wrote:
    > > Hello!
    > >
    > > I'm taking a file name from a database and using the <asp:image> tag in
    > > GridView to show the image. However, some of the file names have
    > > spaces in it and no matter what I do, for example:
    > >
    > > <asp:Image runat=server ImageUrl=<%#
    > > HttpUtility.HtmlDecode((Eval("WallpaperLink"))) %> />
    > >
    > > It still displays the file as: bobs%20image. %20 keeps popping up.
    > > Does anybody have any solutions? Oh yes, I've also tried
    > > URLDecode/Encode
    > >
    > > Thanks for the help!
    > >
    MRW, Sep 30, 2006
    #4
    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. Michal Raatz

    DataGrid and Htmlencode

    Michal Raatz, Jul 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    472
    Michal Raatz
    Jul 29, 2003
  2. Makarand
    Replies:
    0
    Views:
    983
    Makarand
    Nov 6, 2003
  3. Andrea Williams

    Problem with C# Class and Server.HTMLEncode

    Andrea Williams, Jan 27, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    22,226
    Michael Earls
    Jan 27, 2004
  4. Anders Both

    Unicode and HtmlEncode

    Anders Both, Feb 18, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,694
    Anders Both
    Feb 18, 2004
  5. jMehdi

    asp:BoundField and HtmlEncode

    jMehdi, Jul 5, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    553
    jMehdi
    Jul 6, 2007
Loading...

Share This Page