This question is locked. New answers and comments are not allowed.
How can Window title be set to accept utf-8 encoding?
The following show how Telerik Window is used. The action 'Edit' in controller 'Adresse' renders a partial view of an address.
After loading, the character 'Ã ' is not redered properly in the Window's title bar.
@(Html.Telerik().Window() .Name("Window") .Title("Adresse à modifier") .Buttons(b => b.Maximize().Close()) .Visible(false) .Modal(true) .Width(500) .Height(310))@(Html.Telerik().Grid(Model) .Name("Grid") //.ToolBar(commands => commands.Insert()) .ToolBar(commands => commands.Template( @<text> <input type='button' value='Ajouter un contenu' onclick="insertRecord()" /> </text> ))....//removed for brievety columns.Template( @<text> <input type="button" value="Editer" onclick="updateRecord('@item.ID')" /> <input type="button" value="Enlever" onclick="deleteRecord('@item.ID')" /> </text> ).Width(150); })....//removed for brievety)<script type="text/javascript"> function insertRecord() { var url = '@Url.Action("Edit", "Adresse")'; $.post(url, {}, function (data) { var window = $('#Window').data('tWindow'); window.title("Nouvelle adresse"); window.open(); window.content(data); }); } function updateRecord(id) { var url = '@Url.Action("Edit", "Adresse")'; $.post(url, {}, function (data) { var window = $('#Window').data('tWindow'); window.title("Adresse à modifier"); window.open(); window.content(data); }); }
I have tried the following without any success. Can you help resolve this issue?
Thanks
function updateRecord(id) { var url = '@Url.Action("Edit", "Adresse")'; $.ajax({ type: 'POST', url: url, data: { id: id }, success: function (data) { var window = $('#Window').data('tWindow'); window.title("Adresse à modifier"); window.content(data); window.open(); }, scriptCharset: "utf-8", contentType: "text/html; charset=utf-8" });}