且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Jquery ajax在Controller中调用ActionResult方法并返回数据

更新时间:2023-02-16 19:07:16

结果在成功事件上.试试:

The result is on the succes event. Try:

$(document).ready(function () {
$('#button1').click(function () {
    $.ajax({
        type: 'GET',
        url: @Url.Action("All", "Home"),
        datatype: "html",
        success: function (data) { 
            $('#rooms').html(data);
        }
    });
    return false;
}); });