Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
----------
HTML
<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>


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...?
Posted
Updated 28-Jul-11 21:08pm
v2

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.
 
Share this answer
 
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)
XML
function BlockUI() {
            $.blockUI({ message: '<h1><img src="busy.gif" /> Just a moment...</h1>' });
         }

*- function no.2
PHP
function UnBlockUI() {
            $.unblockUI();
         }


4) Make sure the ToolkitScriptManager is exists in master/content page.
5) on save button click call the 1st js function BlockUI
C#
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "BlockUI();", true);

6) After successful insert/update/delete/ any expression call the 2nd js function
C#
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "UnBlockUI();", true);


Block UI Ref. here
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900