protected void Button1_Click(object sender, EventArgs e)
{
TextBox2.Text = HtmlEncode(TextBox1.Text);
}
public string HtmlEncode(string theString)
{
theString = theString.Replace(">", ">");
theString = theString.Replace("<", "<");
theString = theString.Replace(" ", " ");
theString = theString.Replace(" ", " ");
theString = theString.Replace(""", "\"");
theString = theString.Replace("'", "\'");
theString = theString.Replace("<br/> ", "\n");
return theString;
}
{
TextBox2.Text = HtmlEncode(TextBox1.Text);
}
public string HtmlEncode(string theString)
{
theString = theString.Replace(">", ">");
theString = theString.Replace("<", "<");
theString = theString.Replace(" ", " ");
theString = theString.Replace(" ", " ");
theString = theString.Replace(""", "\"");
theString = theString.Replace("'", "\'");
theString = theString.Replace("<br/> ", "\n");
return theString;
}