I have a problem about nested quotes.
<td style="width: 7%;padding-left:30px"><span class="btn btn-succes mainButton" data-toggle="modal" onclick="showStudents(@ViewBag.Acts[i].ActId, '@ViewBag.Acts[i].ActName','@ViewBag.Acts[i].Filter')" style="float: left; background: bisque"><i class="fa fa-sitemap"> Classes</i></span></td>
Uncaught SyntaxError: missing ) after argument list
I think what you may be talking about is that the value of the variable itself contains a quote. For example, if the value of
Foo's, then once Razer finished rendering the view you'd have something like:
onclick="showStudents(1, 'Foo's', ...
Obviously, that's a syntax error. The only thing that you can do in this situation is to escape the quotes:
onclick="showStudents(@ViewBag.Acts[i].ActId, '@ViewBag.Acts[i].ActName.Replace("'", "\\'")', ...
Which would result in:
onclick="showStudents(1, 'Foo\'s', ...
And you should be fine. You'll probably also need to do the same for double quotes, so you don't mess up the