0

I'm building project with .Net MVC and jQuery. The text i want to set as title comes from my resources file. But it can't show spesical characters.

Here is how i set it:

    @if (Model.ConfigService.Current.Customer.ShowOrdinaryTimeScore) {                
        <text>
            $(".match_time .time_played").html('@SharedStrings.MatchResultShort');
            $(".match_time .time_played").attr("title", "@SharedStrings.FullTimeResult");
        </text>
    }

SharedStrings.FullTimeResult contains a "Ç" character. And my html becomes:

<h3 class="time_played" title="'Ma&amp;#231; Sonucu">MS</h3>

as you can see my Ç character has become

&#231;

How can i fix this?

erkan demir
  • 1,386
  • 4
  • 20
  • 38
  • 4
    you need to use `@Html.Raw(SharedStrings.FullTimeResult)` – Pete Jan 06 '15 at 12:49
  • 2
    html encode the string before adding it to the attribute – Van Jan 06 '15 at 12:50
  • 1
    See Blender answer here [link][1] hope this will help. [1]: http://stackoverflow.com/questions/13847485/jquerys-attr-function-breaks-html-with-html-special-characters – Rahul Vyas Jan 06 '15 at 12:51

0 Answers0