I try to render cyrillic word "име" instead of the name of the column(FirstName) in the table from the DataBase but instead i receive some strange symbols "Èìå". I have a <globalization fileEncoding="utf-8" />
in my webconfig and also I've checked the files containing the code and they are all saved as UTF-8.
I am pretty sure the problem is caused by something in ModelRS.edmx or the files contained in this hierarchy. Here are two screenshots that provide more of the code.
Should I just hardcode "Име" in the HTML as I tried and works fine but it feels like bad practice and this is a project I'm showing to a exam judges?
My html block (see also the screenshot for comperhensive info):
@using PagedList.Mvc;
@model PagedList.IPagedList<Rating_System.Models.tblTeacher>
@Html.DisplayNameFor(model => model.First().FirstName)
// I have .First() because the web page has pagination
My controller:
public class TeachersController : Controller
{
private RSEntities db = new RSEntities();
// GET: Teachers
public ActionResult Index(int page = 1, int pageSize = 8)
{
List<tblTeacher> listTeachers = db.tblTeachers.ToList();
PagedList<tblTeacher> model = new PagedList<tblTeacher>(listTeachers, page, pageSize);
//return View(db.tblTeachers.ToList());
return View(model);
}
}
My "Model":
public partial class tblTeacher
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public tblTeacher()
{
this.tblRatings = new HashSet<tblRating>();
this.tblTeachersDisciplines = new HashSet<tblTeachersDiscipline>();
}
public int ID { get; set; }
[Required]
[Display(Name = "Име:")]
[StringLength(50)]
public string FirstName { get; set; }
}