大きな Excel ファイルをデータベースにロードしています。アクティビティが進行中であることをユーザーに見てもらいたい。始めたけど、進め方がわからない。
私の ActionResult Index メソッドには 2 つのパラメーターがあります。JavaScript でこれを定義するにはどうすればよいですか。
送信ボタンをクリックすると、アニメーション画像が表示され、処理が完了すると停止します
どういうわけかdivを非表示にする必要があることを理解しています。これを行う方法がわからない。
手伝ってください。以下は私のコードです。
@model SampleTemplate.Models.ResultViewModel
@{
ViewBag.Title = "Index";
}
<h2>File upload section</h2>
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="uploadSection">
<div id="divloading">
<p style="position:absolute; top:30%; left:45%;color: Red;">
Excel file in process, please wait...<img src="../../Images/animated.gif" />
</p>
</div>
<div>
<p class="headerSection">Select script</p>
<p>
<select name = "genericId">
<option value="12.1">12_1_flat_goods</option>
<option value="12.2">12_2_mats_bm</option>
</select>
</p>
</div>
<div id="spacebetween">
<p class="headerSection">Path to source file: </p>
<p class="spacebelow"><input type="file" name="file" value="" /> </p>
<p><button id="submi" name="Submit" onclick="JavascriptFunction();">Submit</button></p>
</div>
</div>
}
<script type="text/javascript" language="javascript">
function JavascriptFunction() {
var url = '@Url.Action("","Home")';
$("#divLoading").show();
}
</script>
...Here is my method
[HttpPost]
public ActionResult Index(HttpPostedFileBase file, ResultViewModel resModel)
{
//code to upload excel file goes here. No need to show this.
}