Html.ListBoxがあり、アイテムを選択したら、アイテムIDを渡して、選択したアイテムの情報を呼び出してロードできるようにします。このIDをスクリプトに渡す最良の方法は何ですか、それとも別の方法がありますか?
@Html.ListBox("ListBoxName", new SelectList((IEnumerable<Epic>)ViewData["selectedestimate"], "Id", "Name"), new {@class = "ListBoxClass"})
<script type="text/javascript">
$(function () {
$(".ListBoxClass").click(function (event) {
event.preventDefault(); // Stop the browser from redirecting as it normally would
$("#editid").load(this.href, function (response) {
alert('hello'); //this just for testing
});
});
});