on the server side use....
Public Shared Function JREncode(ByVal in_string)
Dim sRtn As String
sRtn = in_string
sRtn = Replace(sRtn, "&", "&")
sRtn = Replace(sRtn, "<", "<")
sRtn = Replace(sRtn, ">", ">")
sRtn = Replace(sRtn, """", """)
sRtn = Replace(sRtn, "'", "'")
JREncode = sRtn
End Function
on the client side use.....
function escapeXML(strInput)
{
// replace special characters that will error out in xml
strInput=strInput.replace(/&/g,"&"); //replace & with &
strInput=strInput.replace(/</g,"<"); //replace < with <
strInput=strInput.replace(/>/g,">"); //replace > with >
strInput=strInput.replace(/"/g,"""); //replace " with "
strInput=strInput.replace(/'/g,"'"); //replace ' with '
return(strInput);
}
rhogan said:
Is there a VB.NET function that will take a string and return it in a xml
friendly string? My problem is this: Pal's Daycare is saved as Pal I lose
everything after the '