有没有办法通过 MVC 操作返回 emptyresult() 在 ajax 成功响应中获取任何内容

Is there way to get anything in ajax success response with MVC action returning emptyresult()

我有一个控制器操作,例如 create(),在完成一些后端工作后,returns emptyresult() 在其中。我通过 ajax 调用我的 create() 操作。现在,如果后端工作成功,我想在 jquery 中 ajax success 中做一些事情。我应该怎么做?

public ActionResult Create(string id)
{
//does something
return new EmptyResult();
}

现在我想在我的 ajax 成功部分做点什么

        $.ajax({
            type: "POST",
            url: "@Url.Action("Create", "controller")",
            data: "{Id:'" + id + "'}",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            async: false,
            cache: false,
            success: function (response) {
                alert();
                $("#getoptionSp").empty();
                $("#getoptionSp").append("<div>Pending<div>");
            },
            error: function () {

            }
        }) 

我想用 jquery 更改前端 .. 如果操作 return 为空结果,我该怎么做。我无法 return 认为代码会更混乱。

好吧,我在尝试 return

时得到了答案
return Json("",JsonRequestBehavior.AllowGet);

我们很高兴获得 ajax 成功响应。