Tuesday, November 19, 2013

js - view

function ShowRacePerLeague(l) {
    event.preventDefault();
    var path = "/Exam/GetLeague/";
    $.ajax({
        url: path,
        dataType: "json",
        data: { league: l },
        type: 'POST',
        success: function (data) {
            $('#tblOutput').html(data);
        }
    });
}



@{
    ViewBag.Title = "ExamHome";
}
<script src="../../Scripts/main.js" type="text/javascript"></script>
<h2>
    ExamHome</h2>
<div style="margin-top: 200px">
    <input type="button" style="height: 30px; width: 100px; float: left; cursor: pointer;
        background-color: Red" value="UK/IRE/SA" onclick="ShowRacePerLeague('UKIRESA')">
     <input type="button" style="height: 30px; width: 100px; float: left; cursor: pointer;
        background-color: Red" value="USA/LARC" onclick="ShowRacePerLeague('USALARC')">
</div>
<div style="clear: both">
</div>
<div id="tblOutput">
    @ViewBag.Table
</div>

No comments:

Post a Comment