I use this razor code to generate a HTML button that calls a function with a value from the model:
Html.Raw(string.Format("<button type='button' class='btn btn-success btn-xs' onclick='setCoordinatorForService('{0}')'>Åta</button>", item.Name))
The value of item.Name is "abc", the code:
<button type="button" class="btn btn-success btn-xs" onclick="setCoordinatorForService(" abc')'="">Åta</button>
I want this:
<button type="button" class="btn btn-success btn-xs" onclick="setCoordinatorForService("abc")'="">Åta</button>
What am i doing wrong?
setCoordinatorForService(\"{0}\")?