1
如何將參數counter
傳遞給我的BindUnbind()
函數?Mvc 3將參數傳遞給javascript
<div id="adver-list">
@{
var counter = 1;
foreach (var adver in (IEnumerable<string>)ViewBag.AdverImages)
{
<div class="adver-image">
<img class="uploaded_image" src="@Url.Content(adver)" alt="advertisement"/>
<input class="hover-delete" id='@adver' type="button" onclick="DeleteAdver(this)"/>
</div>
counter += 1;
}
<script type="text/javascript">
$(document).ready(function() {
BindUnbind(counter, 1); // how to pass the counter from the above code?
});
</script>
}
</div>
謝謝!
很酷的工作!謝謝@Rraham :) – naru