I have a function for turning HTML encoded text back into HTML. It works great normally, but for some reason, I try to use it on some text today, and get the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'UnChkString'
/manage/solutions_delete.asp, line 22
The line I am using this function on is:
<%= UnChkString(solution_desc) %>
The solution_desc
variable is:
<p>Here is a description of what this solution is all about.</p>
The field the database is pulling the solution_desc
from is a text field.
My UnChkString function is:
Function UnChkString(string)
UnChkString = Replace(string,"[%]","%")
UnChkString = HTMLDecode(UnChkString)
End Function
The HTMLDecode function is:
Function HTMLDecode(sText)
Dim I
sText = Replace(sText, "&" , Chr(38))
sText = Replace(sText, "&" , "&")
sText = Replace(sText, """, Chr(34))
sText = Replace(sText, "’", Chr(39))
sText = Replace(sText, "<" , Chr(60))
sText = Replace(sText, ">" , Chr(62))
sText = Replace(sText, " ", Chr(32))
For I = 1 to 255
sText = Replace(sText, "&#" & I & ";", Chr(I))
Next
HTMLDecode = sText
End Function
EDIT
I've even tried:
<%= UnChkString(CStr(solution_desc)) %>
with no luck.