Re: HTML converted to ASCII when saved in SQL

  •  03-24-2006, 9:55 AM

    Re: HTML converted to ASCII when saved in SQL

    I managed to solve my own problem just by getting some sleep and looking at this again in the morning.  The solution is to make sure I use Server.HTMLDecode when inserting into the db and again when extracting the html before rendering it in the span:
     
    SQL Parameter Insert changed to this:
     
    daTemplate.SelectCommand.Parameters.Add(New SqlParameter("@TemplateHTML", SqlDbType.Text))daTemplate.SelectCommand.Parameters("@TemplateHTML").Value = Server.HTMLDecode(teTemplate.Text)
     
    Change the output side to this:
     
    HtmlHolder.InnerHtml = Server.HtmlDecode(TemplateString.ToString)
     
View Complete Thread