I have an aspx page with a textbox and button. When I clicked button, it's sending textbox's text to a function and saves it to database using entity framework. The issue is when I use my local characters in textbox such as ş, ğ, ı, ö , ü, these characters are saved as s, g, i, o, u. What is the problem?
My codes (Product.aspx)
<asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
<asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
(Product.aspx.cs)
protected void btnUpdate_Click(object sender, EventArgs e)
{
Product p = new Product ()
{
Id = Int32.Parse(Session["ProductId"].ToString()),
Title = txtTitle.Text
};
int productId = ProductManager.UpdateProduct (p);
if (productId != -1)
{
// SUCCESS
}
else
{
// ERROR
}
}
public static int UpdateProduct(Product product)
{
using (var context = new LidyaEntities())
{
Product pUpd = context.Product.FirstOrDefault(p => p.Id == product.Id);
if (pUpd != null)
{
pUpd.Title = product.Title;
}
return context.SaveChanges();
}
}
Database table (SQL SERVER);
(Id, int)
(Title, text)