i have a strongly typed asp.net-mvc view and the Model has a .Links property.
Links is an array of link, which has a URL, a Description and an ID.
i have a bunch of links. Every links has a list of tags and those tags are layed out like this:
<a id="98" href="www.ibm.com>IBM</a><b class='dblclick'>Tags: Software</b>
<a id="99" href="www.microsoft.com>MIcrosoft</a><b class='dblclick'>Tags: Software</b>
<a id="100" href="www.apple.com>Apple</a><b class='dblclick'>Tags: Software, Fruit</b>
(www.ibm.com being the URL, IBM being the Description, and "98" being the ID)
i have the following jquery code:
<script type="text/javascript">
$(document).ready(function() {
$(".dblclick").editable('<%=Url.Action("UpdateSettings","Links", new { site = Model.Links[0].ID }) %>', {
tooltip: "Doubleclick to edit...",
event: "dblclick",
style: 'display: inline; width:400px;'
});
});
the issue that i dont want to have: Model.Links[0].ID hard coded, i want to pass in the index into the method (98 in this case). Since every link has the "dblclick" class, how do i pass in the exact link or index into this array so i can stick in the ID field into this editable method?