RedirectToAction with Ajax.Beginform , unexpected results

前端 未结 2 1588
粉色の甜心
粉色の甜心 2020-12-11 04:14

I have the following view , which contains an Ajax.BeginForm:-

@using (Ajax.BeginForm(\"ChangeDevicesSwitch\", \"Switch\", new AjaxOptions

{
    InsertionMo         


        
2条回答
  •  青春惊慌失措
    2020-12-11 04:48

    in my case, following method was worked

    function OnSuccess(data) {
        var json;
            if (data.responseText instanceof Object)
                json = data.responseText;
            else
                json = $.parseJSON(data.responseText);
    
            if (json.RedirectUrl)
                window.location.href = json.RedirectUrl;
    }
    

提交回复
热议问题