Razor ajax进度条与bootstrap

时间:2016-05-31 19:17:01

标签: javascript jquery ajax twitter-bootstrap razor

我希望使用带有Razor ajax表单的bootstrap进度条,但我不确定如何继续。每当我搜索主题时,我都会得到jquery ajax的结果,如one,但不是Razor ajax形式。我的剃刀形式如下:

microbenchmark(dplyr= Reduce(mydplyr, df_list),
               dt = Reduce(mydt, dt_list), times=50)

Unit: seconds
expr      min       lq     mean   median       uq      max neval cld
dplyr 34.48993 34.85559 35.29132 35.11741 35.66051 36.66748    50   b
   dt 10.89544 11.32318 11.61326 11.54414 11.87338 12.77235    50  a 

这是jquery ajax。

@using (Ajax.BeginForm("MyAction", null,
new AjaxOptions
{
    HttpMethod = "POST", 
    InsertionMode = InsertionMode.Replace, 
    UpdateTargetId = "myDiv"
}, new { @class = "form-inline" }))
{
   ...
}

由于Razor没有ajax选项$.ajax({ url:"", async: true, xhr: function () { var xhr = new window.XMLHttpRequest(); //Upload Progress xhr.upload.addEventListener("progress", function (evt) { if (evt.lengthComputable) { var percentComplete = (evt.loaded / evt.total) * 100; $('div.progress > div.progress-bar').css({ "width": percentComplete + "%" }); } }, false); //Download progress xhr.addEventListener("progress", function (evt) { if (evt.lengthComputable) { var percentComplete = (evt.loaded / evt.total) *100; $("div.progress > div.progress-bar").css({ "width": percentComplete + "%" }); } }, false); return xhr; }, ,我将如何完成此行为?

0 个答案:

没有答案