Server.HTMLEncode

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ashishc
    New Member
    • Jan 2008
    • 12

    Server.HTMLEncode

    Hi All,
    I have an asp form and server.htmlenco de is not working for the text field only for ampersand sign.
    If I enter A&M, it cuts off the &M and only A is displayed. If I enter A<1, that works fine..

    <input type="Text" name="Title" size="35" maxlength="60" value="<%=Serve r.HTMLEncode(oO bject.Title)%>" >

    Any thoughts?

    Ashish
  • CroCrew
    Recognized Expert Contributor
    • Jan 2008
    • 564

    #2
    Hello ashishc,

    Try this:

    <input type="Text" name="Title" size="35" maxlength="60" value="<%=Repla ce(oObject.Titl e, "&", "&amp;")%>" >
    </textarea>


    Hope this helps you out~

    Comment

    Working...