Click here to Skip to main content
15,887,358 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hai All I have a web application which is developed using c#.net. I get details from database When I click Ok button It takes sometime to load the data from database. At this time I need to show a message saying that Data is loading..... After loading the data The message should go off. The message should be in a box or in a panel.

Kindly give me an sample code or application.
Posted
Updated 20-Apr-11 7:56am
v2
Comments
Sandeep Mewara 20-Apr-11 10:51am    
Winforms or ASP.NET web app?
sacraj 20-Apr-11 12:35pm    
ASP.net web app

To do any sort of client-side updates like this you need to have a simple, quick shell page which appears quickly and then calls the time-consuming script via AJAX, which is asynchronous and allows the client-side script to display a loading message.
 
Share this answer
 
Comments
Nish Nishant 20-Apr-11 10:08am    
Voted 5, and proposed as answer!
Sandeep Mewara 20-Apr-11 10:51am    
I thought the question was for Winforms and not ASP.NET!
BobJanova 20-Apr-11 11:16am    
The question says 'web application' so I inferred ASP.net. It could also be Silverlight/WPF I suppose.
Sandeep Mewara 20-Apr-11 11:25am    
:doh: :doh: :doh:

My bad!!!
RaviRanjanKr 20-Apr-11 13:59pm    
Nice Answer! My 5 :)
Simply set the panel when you start interacting with the database and remove/hide it when you are done. The best would be to create a start end end method you can call, this makes it easier to make changes or add extras like showing the hourglass mouse pointer for example.

Good luck!
 
Share this answer
 
hello
try this

on aspx page put your grid etc inside the update panel

XML
<asp:UpdatePanel ID="up" runat="server">
        <ContentTemplate>
            <asp:Panel ID="panel1" runat="server" Visible="false" CssClass="loading">
                Please wait while loading.....
                <%--other db related control--%>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>

in .cs page
C#
private void GetDetailFromDB()
{
    panel1.Visible = true;
    up.Update();
    //other codes to get detail from db
    panel1.Visible = false;
}

use css to set the panel in the center of the screen.
best siches
 
Share this answer
 
v2
Comments
sacraj 20-Apr-11 12:59pm    
Could You please make it clear with out "
because I do not understand
thatraja 20-Apr-11 13:55pm    
Hi, now check his answer, I have fixed the format.

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