0

I have a Javascript function below, which takes a label defined in resx.file... Label is something like: Success from customer's price list.

enter code here: $(function () {
    systemadminhourlyrateindex().init(
        '@Html.Raw(Label.SuccessDeleteIsDelegated)' //At this point label is as origin.
    );
});

But when I try to use it in JS function, it dose not escape the single quote from customer's correctly. Instead it adds wierd chars something into the word customers. So it becomes something like customer---s where --- is & # 3 9; Maybe this is ascii for single quote?

3

1 Answer 1

0

This worked out for me.

@Html.Raw(HttpUtility.JavaScriptStringEncode(YouLabel)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.