如何显示正在加载图像或文本,直到我的保存消息在ASPX中显示 [英] How to display Loading Image or text till my Save messages display in ASPX

查看:65
本文介绍了如何显示正在加载图像或文本,直到我的保存消息在ASPX中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



以下代码是ASP的迁移.

当我单击按钮(它是一个ASP Bttuon)时,然后我想立即显示加载消息.
一旦完成数据保存,然后隐藏正在加载的图像,然后显示保存"消息.

请参阅我的代码.
------------

ASPX代码
----------

Hi,

The below code is the migration of ASP.

When i click the button (it is a ASP Bttuon), then immediately i want to display the loading message.
Once, the data saving is completed, then loading images should get hide and then "Save" message should get display.

See my Code.
------------

ASPX Code
----------

<table><tbody><tr><td colspan="5">
        <input type="button"  önclick="AddEmployee(<%=Session("Record")%>);" value="Import Checked Contacts" name="B3" style="font-family: Trebuchet MS; font-size: 9pt; color: #000080" />
</td></tr></tbody></table>
<%
    If Request("M") = "S" Then %>
        <tr>
            <td id="lbl1" align="center" class="contentred" colspan="5">Record(s) Saved Successfully
            </td>
        </tr>
    <%  End If%>
<script type="text/javascript" language="Javascript">
       function AddEmp(Rec) {
        emp = '';
        for (i = 1; i <= Rec; i++) {
            if (document.getElementById("Emp" + i).checked == true) {
                emp = emp + document.getElementById("Emp" + i).value + '~'
            }
        }
        document.Dep.SelEmp.value = emp
        document.Dep.action = "OtherEmp.aspx?M=S"
        document.Dep.submit();
    }
</script>



在这里,没有任何代码.我只有ASPX Page.因为这是迁移项目.

如何显示加载图像或文本,直到显示我的保存消息.
请提供更多解决方案以在ASPX页面中显示加载消息...?



Here, there is no code behind. i have only ASPX Page.Because this is migration project.

How to display Loading Image or text till my Save messages display.
pls. give more solution to display loading message in ASPX Page...?

推荐答案

您可以添加Image控件和Label.
在按钮上单击,设置Image1.Visible = true;.保存过程完成后,即在保存功能结束时,设置Image1.Visible = false; Label1.Visible = true;

为此,请使用AJAX控件工具包UpdatePanel,UpdateProgress ...,以避免页面刷新和完整的回发.
You can add an Image control and a Label.
On Button click, set Image1.Visible=true; and when save process is complete, i.e. at the end of save function, set Image1.Visible=false; Label1.Visible=true;
or
Use AJAX Control Toolkit UpdatePanel, UpdateProgress... for this to avoid page refresh and complete postback.


请按照以下步骤操作:

在head标签内下载并添加以下.js文件.
1)jQuery v1.2.3或更高版本
2)jquery.blockUI.js
3)在脚本标签中粘贴以下两个js函数
*-1号功能(您可以使用任何加载程序映像)
Follow the steps:

Download and add the following .js files inside head tag.
1) jQuery v1.2.3 or later
2) jquery.blockUI.js
3) Paste the following two js functions within your script tag
*- function no.1 (you can use any loader image)
function BlockUI() {


.blockUI({message:'< h1 > < =" busy.gif" ">/ > 请稍等... < /h1 > '}); }
.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' }); }


*-2号功能


*- function no.2

function UnBlockUI() {


这篇关于如何显示正在加载图像或文本,直到我的保存消息在ASPX中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆