如何在MVC中创建启动画面 [英] How to create Splash Screen in MVC
本文介绍了如何在MVC中创建启动画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我单击显示消息您的数据正在保存.请稍候..."的保存按钮时,我想创建一个初始屏幕.我正在使用MVC 5进行开发.
I want to create a splash screen when i click a save button showing message "Your data are being save. Please wait...". Im using MVC 5 for my development.
下面我创建了一个div:
Below i created a div:
<div id="divSplash" style="margin: 0px; padding: 0px; position: fixed; right: 0px;
top: 0px; width: 100%; height: 100%; background-color: #ffffff; display:none">
<p style="position: absolute; top: 30%; left: 45%; color: White;">
Your data are being save. Please wait...<img src="../../Images/ajax-loading.gif">
</p>
</div>
真的很感谢你们的帮助.谢谢.
Really appreciate if your guys can help to solve it. Thank you.
推荐答案
我认为您应该使用Ajax Form.
I think you should use Ajax Form.
@using (Ajax.BeginForm("PerformAction",
new AjaxOptions { LoadingElementId="divSplash", OnSuccess = "OnSuccess" }))
{
...
<input type="submit" value="Submit" />
}
<div id="divSplash" style="display: none;">
<img src="loading.gif" alt="Loading..." />
</div>
如何使用 Ajax .BeginForm 那是旧帖子,但解释很清楚.
How to use Ajax.BeginForm That is the old post but having very clear explanation.
这篇关于如何在MVC中创建启动画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文