I have a Html.ListBox and upon selecting an Item I would like it to pass the item Id in so that I can call and load that selected Item's Information. Whats the best way to pass this id in to a script or maybe is there another way?
@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
});
});
});