I need the ability to dynamically set an onclick using an HTML Helper. the below is what I’m trying to do, but i’m getting an obvious syntax error
<%=Html.CheckBox("checkboxname", item.Id = 3, New With {.onclick = "ajaxThis(this, <%= Html.Encode(item.ID) %>, '<%= Html.Encode(item.NUMBER) %>');"})%>
The first step would be to remove the <%= %> from <%= Html.Encode(item.ID) %> and just call Html.Encode(item.ID) directly. Do the same with the item.NUMBER encoding.
Something like: