TextEditor not inserting the right character into table
html
<cc1:Editor ID="txtEditor" runat="server" CssClass="form-control" Width="100%" BackColor="WhiteSmoke" Height="600px" Font-Names="Comic Sans MS"/>
code
protected void btnSubmit_Click(object sender, EventArgs e)
{
if (Session["UserName"] != null && Session["UserName"].ToString() != string.Empty)
{
string username = Session["UserName"].ToString();
//GetPost(username);
}
string str = ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
string getADPOST = "Insert INTO ReadMessage (UserName,FriendUserName,Title,Message) values (@UserName,@FriendUserName,@Title,@Message)";
// string getADPOST = "Insert INTO CommunityFollow (MyUserName,FriendUserName,CommunityStatus) values (@MyUserName,@FriendUserName,1)";
using (SqlConnection con = new SqlConnection(str))
{
con.Open();
using (SqlCommand cmd = new SqlCommand(getADPOST, con))
{
// Get Filename from fileupload control
//string filename = Path.GetFileName(FileUploadImage.PostedFile.FileName);
// // Save images into Images folder
// Server.MapPath("~/UserImage/" + FileUploadImage.FileName);
// cmd.Parameters.AddWithValue("@ImageName1", filename);
// cmd.Parameters.AddWithValue("@ImageName1", "~/UserImage/" + filename);
cmd.Parameters.AddWithValue("@FriendUserName", txtTO.Text.Trim());
cmd.Parameters.AddWithValue("@Title", txtSubject.Text.Trim());
cmd.Parameters.AddWithValue("@Message", txtEditor.Content.Trim());
// cmd.Parameters.AddWithValue("@UserName", Session["UserName"].ToString());
cmd.Parameters.AddWithValue("@UserName", Request.QueryString["Id"].ToString());
// cmd.Parameters.AddWithValue("@FriendUserName", Request.QueryString["Id"].ToString());
//cmd.Parameters.AddWithValue("@Id", Session["Id"].ToString());
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable ds = new DataTable();
da.Fill(ds);
}
}
}
}
the inserted character into table
HJKL;<br />
<br />