Professional Web Applications Themes

How to decode strings encoded with HTMLEncode - ASP Components

I have some input fields on an asp page that get populated from fields in a database. The user can edit the fields, and when the form is submitted the database fields are updated with the new values. Some of these fields may contain quote marks. When populating the input fields from the database, I can use the Server.HTMLEncode method to prevent HTML errors caused by the quotes. But there doesn't seem to be an equivalent Server.HTMLDecode method. How can I decode the values of the input fields so that the values written to the database contain the actual quote ...

  1. #1

    Default How to decode strings encoded with HTMLEncode

    I have some input fields on an asp page that get populated from fields in a
    database. The user can edit the fields, and when the form is submitted the
    database fields are updated with the new values.

    Some of these fields may contain quote marks. When populating the input
    fields from the database, I can use the Server.HTMLEncode method to prevent
    HTML errors caused by the quotes. But there doesn't seem to be an
    equivalent Server.HTMLDecode method.

    How can I decode the values of the input fields so that the values written
    to the database contain the actual quote marks instead of the encoded
    version (")?

    Thanks in advance,
    --Rob Roberts




    Rob Roberts Guest

  2. #2

    Default Re: How to decode strings encoded with HTMLEncode

    Uh, never mind on this one. HTMLEncode was the wrong approach to the
    problem in the first place.

    --Rob Roberts

    "Rob Roberts" <robrRemoveThisAndThisToo.pcisys.net> wrote in message
    news:uYc0IjtZFHA.3712TK2MSFTNGP09.phx.gbl...
    >I have some input fields on an asp page that get populated from fields in a
    >database. The user can edit the fields, and when the form is submitted the
    >database fields are updated with the new values.
    >
    > Some of these fields may contain quote marks. When populating the input
    > fields from the database, I can use the Server.HTMLEncode method to
    > prevent HTML errors caused by the quotes. But there doesn't seem to be an
    > equivalent Server.HTMLDecode method.
    >
    > How can I decode the values of the input fields so that the values written
    > to the database contain the actual quote marks instead of the encoded
    > version (&quot;)?
    >
    > Thanks in advance,
    > --Rob Roberts
    >
    >
    >
    >

    Rob Roberts Guest

Similar Threads

  1. Extracting strings delimited by other strings
    By Scott Bass in forum PERL Modules
    Replies: 2
    Last Post: May 7th, 02:26 AM
  2. how to decode encoded characters
    By Ramprasad A Padmanabhan in forum PERL Beginners
    Replies: 0
    Last Post: September 5th, 09:41 AM
  3. Web Service Iso encoded
    By Phillip in forum ASP.NET Web Services
    Replies: 1
    Last Post: August 23rd, 01:07 PM
  4. PHP encoded files
    By fartsniff in forum PHP Development
    Replies: 3
    Last Post: August 10th, 08:33 PM
  5. DataGrid and Htmlencode
    By Michal Raatz in forum ASP.NET General
    Replies: 0
    Last Post: July 29th, 07:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139