ファイルをダウンロードするリンクがありますが、プロセスに時間がかかる場合があるため、ダウンロードが行われていることをユーザーに通知する JQ モーダル ダイアログを表示したいと考えています。
JQuery モーダルの使用: http://jqueryui.com/demos/dialog/#modal
@model MvcResComm.Models.FileList
@{
ViewBag.Title = "Download";
}
<script src="../../Scripts/jquery-1.8.0.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.20.min.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-ui-1.8.23.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('a').click(function () {
$("#dialog-modal").dialog({
height: 140,
modal: true
}, 'open');
});
});
</script>
<h2>Download</h2>
<table>
@foreach (KeyValuePair<string, string> item in Model.Files) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.Value)
</td>
<td>
@Html.ActionLink("Download", "DownloadFile", new { fileid = item.Key, token = Model.Token, platform = "windows" })
</td>
</tr>
}
</table>
<div id="dialog-modal" title="Basic modal dialog">
<p>Download in progress.</p><span class="loading"> </span>
</div>