The following markup shows my form:
<div id="category-form">
</div>
The following code is my script:
<script type="text/javascript">
function clicked(o) {
var id = o.getAttribute("data-categoryId");
var name = o.getAttribute("data-categoryName");
var description = o.getAttribute("data-description");
loadFormView("/Admin/_EditCategories?categoryId="+ id + "&categoryName="+name+"&description="+description);
}
function loadFormView(url) {
$.ajax({
url: url,
type: 'GET',
cache: false,
success: function (data) {
$("#category-form").html(data);
alert(data);
}
});
}
</script>
I have also created a controller that passes data to the view:
public PartialViewResult _EditCategories(int categoryId, string categoryName, string description)
{
Category category = new Category();
category.CategoryId = categoryId;
category.CategoryName = categoryName;
category.Description = description;
ViewBag.Action = "Cập nhật";
ViewBag.Task = "Sửa thể loại truyện";
ViewBag.IsEdit = true;
return PartialView("_TaskCategories", category);
}
When the view renders the ViewBag content and it's rendered on IE, the text is garbled whereas on Chrome and Firefox, the text appears correctly, in Vietnamese.
"Truyện cười" is categoryName's value
in textbox on ie: "Truy?n c??i" and.... on ff or chrome: "Truyện cười"
How can I fix the text rendering in IE? Thank you in advance!