I am trying to send a Dictonary key (which is a string) to a Javascript function.
<%
foreach (var field in Model.Fields)
{ %>
<tr><td>
<a href="#" onclick="javascript:EditField(<%= field.Key %>)">
<%= Html.Encode(field.Value.Name) %></a>
</td><tr>
<% } %>
But, on the Javascript function, I get it as an object which has the entire 'FIELD' object that I have. I don't get it as a string.
My JS function looks like this -
function EditField(field) {
// blah blah
}
Are there any 'gotchas' when sending Dictonary keys to a JS function?