I think you need to put quotes around the second parameter if this is a string:
<a onclick=" SelectBenefit(<%=o.ba_Object_id %>, '<%=o.ba_Object_Code %>')" href="#">Select</a>
This suggests that your parameters must be correctly encoded, and I will not pass them. I would serialize them as a JSON object to make sure everything is in order. Like this:
<a onclick="SelectBenefit(<%= new JavaScriptSerializer().Serialize(new { id = o.ba_Object_id, code = o.ba_Object_Code }) %>)" href="#">Select</a>
and then the SelectBenefit function might look like this:
function SelectBenefit(benefit) { alert(benefit.id); alert(benefit.code); }
source share