خرید بک لینک

Vote count: 0

i'm using mvc patte in asp.net - c#. In my application I use jquery.blockUI to block user interface while the page is loading. First, I implement this in forms, like this:

wait.js:

$('#form').on("submit", function(){

    $.blockUI({message:null});

});

View:

@using (Html.BeginForm("Create","Caterings", FormMethod.Post, new { @id = "form"})) { ....

Now i'm trying implement similar solution but using simple @Html.ActionLink and i can't get it. I used javascript with ajax but i think ajax isn't for this purpose, because my objective is redirect all the page to another view.

in actionlink I use:

<li>@Html.ActionLink("Costos Unitarios", "Edit", "CostosFijosUnitarios", new { @onClick= "RedirigirPantalla('Edit','CostosFijosUnitarios')" })</li>

and js:

function RedirigirPantalla(accion, controler) {

        alert("accion: " + accion + " y controller: " + controler);

        $.ajax({
            contentType: 'application/html; charset=utf-8',
            type: 'GET',
            beforeSend: function () {                    
                $.blockUI({ message: null });
            },
            complete: function (actionResult) {
                $.unblockUI({ message: null });
                document.location.href = actionResult;
            },
            dataType: 'html',
            url: '@Url.Action("action", "controller", null)'.replace("action",accion).replace("controller",controler),
            success: (function (actionResult) {
                alert("Success " + actionResult.toString());
            }),                
            error: (function (actionResult) {
                alert("ERROR " + actionResult.toString());
            })
        });           

    }

With this code I can call the controller successfully, but I don't know what to do with ActionResult that it retus.

Any ideas??

Thanks!!

asked 19 secs ago

برچسب: , how to use snapchat , how to use instagram stories , how to use uber , how to use apple pay , how to use a tampon , how to use excel , how to use twitter , how to use a french press , how to use instagram , how to use airdrop , , نویسنده: استخدام کار تاريخ: يکشنبه 17 مرداد 1395 ساعت: 11:48

صفحه بندی