I am calling the following in a partial view;

 @Html.RadioButton("answers", @a.Item1, new { @OnClick = @Html.Raw(string.Format("AnswerSelected('{0}','{1}');", @a.Item2, @a.Item1)) })@a.Item2

This produces the following on teh page;

<input OnClick="AnswerSelected(&#39;Yes&#39;,&#39;2&#39;);" id="answers" name="answers" type="radio" value="2" />Yes

Removing the @Html.Raw makes no difference.

So its encoding the ' around the parameters. How do I stop this, or am I approaching the problem incorrectly?

Related posts

Recent Viewed