// Server.Encode() will help to convert entire HTML to encoded format.
protected void btnSubmit_Click(object sender, EventArgs e)
{
int status = objBL.SaveContent(Server.HtmlEncode(wftxtContent.Text),wddlPageName.SelectedValue.ToString());
}
public int SaveContent(string content,string pageid)
{
Query = "UPDATE [PageContent] SET PageContent = '" + content + "' WHERE [ID] = " + pageid;
Database objDB = DatabaseFactory.CreateDatabase();
int chkInsert = objDB.ExecuteNonQuery(CommandType.Text, Query);
return chkInsert;
}
// For decode the data from data base
// Server.Encode() will help to convert entire HTML to encoded format.
wftxtContent.Text = Server.HtmlDecode(objBL.getContent());
public string getContent(string pageid)
{
Query = "SELECT PageContent FROM [PageContent] WHERE [ID] = " + pageid;
Database objDB = DatabaseFactory.CreateDatabase();
string Content = objDB.ExecuteScalar(CommandType.Text, Query).ToString();
return Content;
}
No comments:
Post a Comment