Handling files with & in name

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David C

    Handling files with & in name

    I have an asp.net VB application that gets a filename and tries to display
    it on a web page. It seems to be truncating the name when the name contains
    "&" in it. Below is what I am using to grab the name. How can I get around
    that? Thanks.
    David

    If Not Request.Cookies ("path") Is Nothing Then
    strPath = Server.HtmlEnco de(Request.Cook ies("path").Val ue)
    strPath = Request.Cookies ("path").Val ue
    End If


  • Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

    #2
    Re: Handling files with & in name

    You should use HtmlEncode when placing the value IN the cookie.
    You should use HtmlDecode when retrieving the value from the cookie.

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    HALOJP menyediakan link slot gacor terbaru yang gampang JP dengan scatter deras, RTP tinggi, pola maxwin akurat, dan peluang menang besar setiap hari.




    "David C" <dlchase@lifeti meinc.comwrote in message
    news:upGjYMejIH A.248@TK2MSFTNG P04.phx.gbl...
    >I have an asp.net VB application that gets a filename and tries to display
    >it on a web page. It seems to be truncating the name when the name
    >contains "&" in it. Below is what I am using to grab the name. How can I
    >get around that? Thanks.
    David
    >
    If Not Request.Cookies ("path") Is Nothing Then
    strPath = Server.HtmlEnco de(Request.Cook ies("path").Val ue)
    strPath = Request.Cookies ("path").Val ue
    End If
    >
    >

    Comment

    Working...