Home » Asp.net

Loading please wait image show hide


I am trying to implement the loading please wait image funtionality while controls refersh on the page. Here are steps I have taken:

1. Added the image to the .net solution file in the image folder.
2. Added a div with the hidden class that holds the image source on the webform.

Image loads hidden by default and I am trying to show it when any postback or partial post back occurs. There are several controls like dropdowns, checboxes, gridview etc and links in the gridview that could take a few moments to load so I want to display the loading please wait while they reload after selections are made. All Controls exist in the update panel. I can't figure out how to show the image and hide it again when controls are reloaded. I am trying to add to this existing jQuery, my challenge is events occur after the document has been loaded so I need to add Ajax events to this query to show hide the loading please wait image. Here is what I have so far

//Dialog box settings

$(document).ready(function() {

    // $("mytest").dialog({
        title: "   Test",
        resizable: false,
        modal: true,
        height: 100,
        width: 100,
        autoOpen: false,
         buttons: {
            'OK': function() {
            'Cancel': function() {

    $(".myLink").live("click", function(e) {
          var id = $(this).html();
        var mytext = "my first Test";

        $("#mydiv1']").dialog("option", "title", "Test");
        $("#mydiv2").html("Comments: " + mytext);



Here is the code I have tried but it does not kick off, I am not sure how to combine it with the code above:




5 Answers Found


Answer 1

You can  do with javascript.. but it's not  100%  accuracy...Try using ajax  preloader component  and its open source  to download



Start from here...




Answer 2

Thanks, but I rather not start over, I am trying to build upon what I already got.  I just need help with the jQuery part.


Answer 3

Can you post  your current markup in aspx? that would be helpful to check and fix missing part.


Answer 4

Problem is in the jQuery and not in the markup.  I need to put together the jQuery code I posted above or some thing similar to it. 


Answer 5

The biggest problem you are going to have once you get most of this to work is the definition of document.ready is different with IE, FF, Safari, Chrome, and Opera. There are a couple pretty easy ways to handle this thou. On a full page  post-back I use this simple trick:


 document.body.onload = function(){



function switchDivs(){

//Fade out your loading  message, that is pre-assigned to be positioned over the page



With partial  post backs you can do this same thing with the ajaxStart() and ajaxStop() methods built into jQuery.




I´m creating DataGrid columns dynamicly in C# and loading data into a list at the same time. Cursor is waiting at the same time. Now, after columns are created and data is loaded into a list. I set the myDataGrid.Itemssouce = mylist; Cursor=Curosrs.Arrow;

Andafter that, I set the Cursor to arrow again as you can see. But when the list contains thousands of rows it takes about 5-10 seconds for the datagrid to show the rows. Its ok but I need the cursor to be in waiting stage allso while data is not shown but the cursor is not waiting, its arrow. Any suggestions, please?



I am trying to show loading please wait image while data is returned. Image is in a hidden DIV but I need to show it in the center on the page on top of the underlying controls and I am not sure how to do it. It's always shown at the bottom of the page. I tested it by make the display:block, here is my CSS:





I want to display gif image when a page is loaded...

I have a dropdown list when this is selected Gridview is populated with data from database..

I want to show a gif image when this gridview is populated...

how to implement this without AJAX...






I am having a problem with the wait graphic and load screen in Report Viewer.  I am using MS Report Viewer 10 with Visual Studio 2008 with SQL Server 2008 R2.


The problem is that when I try to embed the Report Viewer in another page the little spinning wait graphic doesn't show up and the Toolbar shrinks in width to a quarter of what it is when the report finally loads.  I have read the forums regarding setting the Asynchronous Rendering to true/false but the issue still doesn't go away after that.  The wait graphic and toolbar width were working fine when I was using ReportViewer 9 but when I switched to 10 that is when this became a problem.  Could someone please get back to me, I am stuck and don't know what else to do to get this thing to show that pretty spinning wheel.  I am using WebForms 3.5 and ReportingServices2005.


I am using Report Builder 2.0 to generate letters. Each of my letters has a different image. In the Image Properties , I have set the image source to External, and use this expression to load it: = "/Printing/Logos/" & (Fields!DealerLogo.Value) & ".png"

This works fine, until I have a row that doesn;t have an image. Is there a way I can suppress the image if none is found? Currently I get the red x when no image is located.


hi friends,

How to show/hide gif image when button click in asp.net


using gridview to show data from table. on the aspx page i want to hide/show image depending on the value of one of the fields of a table. for e.g. say is_new=1 then show else hide where is_new is table field.

for this on aspx page i have one img element whose initial visible property is set to false. Now at runtime i want to show/hide image depending on value in each record. So what coding needs to be done and where?



i have a jquery modal dialog box which displays on page load of my asp.net web app - i am using asp.net aspx pages and c#

how can i hide this pop up if a value for example is false and display it if a value is true?

the following is my jquery code:

$(function() {


modal: 'true',

title: 'title'



any advise would be much appreciated as i am new to jquery and its quite a learning curve

many thanks



My application (using javascript API v6) makes use of both the bing maps basemaps and also our own general tile layers for choice of base map - the user has the option of changing between bing/non-bing maps after the map has already loaded, using methods map.ShowBaseTileLayer() and map.HideBaseTileLayer() described in the documentation: http://msdn.microsoft.com/en-us/library/ee692179.aspx

There seems to be an issue with the bing tiles not completely disappearing when using map.HideBaseTileLayer(). For example sometimes the bing tiles in the centre of the screen will be hidden but once the map is panned the bing tiles then appear. Also when zooming in and out of the map the bing tiles sometimes will display. There may also be a problem with the browser caching the bing tiles / delays in new tiles being requested, i'm not sure..

Is anyone else familiar with this problem and possible fixes?

Many thanks


I use ASP.NET MVC: Draw charts use server side code in aspx directly, and have FormsAuthentication.SetAuthCookie in action method. The chart image always got a "X" when first time loading page.

Thanks in advance for your help


<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<%@ Register assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI.DataVisualization.Charting" tagprefix="asp" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server">
    <h2><%= Html.Encode(ViewData["Message"]) %>
        To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">http://asp.net/mvc</a>.
						System.Web.UI.DataVisualization.Charting.Chart Chart2 = new System.Web.UI.DataVisualization.Charting.Chart();
                        Chart2.Width = 412;
                        Chart2.Height = 296;
                        Chart2.RenderType = RenderType.ImageTag;
                        Chart2.Palette = ChartColorPalette.BrightPastel;
                        Title t = new Title("No Code Behind Page", Docking.Top, new System.Drawing.Font("Trebuchet MS", 14, System.Drawing.FontStyle.Bold), System.Drawing.Color.FromArgb(26, 59, 105));
                        Chart2.ChartAreas.Add("Series 1");

						// create a couple of series
                        Chart2.Series.Add("Series 1");
						// add points to series 1
                        foreach (int value in (List<int>)ViewData["Chart"])
                            Chart2.Series["Series 1"].Points.AddY(value); 

                        Chart2.BorderSkin.SkinStyle = BorderSkinStyle.Emboss;
                        Chart2.BorderColor = System.Drawing.Color.FromArgb(26, 59, 105);
                        Chart2.BorderlineDashStyle = ChartDashStyle.Solid;
                        Chart2.BorderWidth = 2;


						// Render chart control
                        Chart2.Page = this;
						HtmlTextWriter writer000 = new HtmlTextWriter(Page.Response.Output);


        public ActionResult Index()
            ViewData["Message"] = "Welcome to ASP.NET MVC!";
            List<int> chartList = new List<int>();

            ViewData["Chart"] = chartList;
            FormsAuthentication.SetAuthCookie("TEST", false);
            return View();

' using this to load pictures works
' Load graphics
path = Program.Directory
background = ImageList.LoadImage( path + "/images/bg1.png")
playerShip = ImageList.LoadImage( path + "/images/PShip.png"
' then using this to show the bg image also works
GraphicsWindow.DrawImage( background, 0, 0 )

Now i'm trying to upgrade this so that each stage of the level has a different background image. I'm trying to do this using an array but can't get it work.

Notice i'm how trying to use and array to load and show the pictures
' Load graphics path = Program.Directory stages = 8 'stages per level, must also be this many bg pictures For stage = 1 to stages background[stage] = ImageList.LoadImage( path + "/images/bg" + stage + ".png") EndFor playerShip = ImageList.LoadImage( path + "/images/PShip.png") 'then i try to show the first bg image like this
GraphicsWindow.DrawImage( background[stage], 0, 0 )

' next is to display the next image from array for the next stage

stage = stage + 1
if stage > stages then
stage = 1
' change bg
GraphicsWindow.DrawImage( background[stage], 0, 0 )

I don't get any errors when i execute the program. It program starts and runs fine but none of the backgrounds appear.

In an attempt to debug i placed the following two lines after the array that loads the graphics.


The textwindow looks like this:




Any advice would be appreciated.




Hello everyone. I've got a quick question. I wrote an application that parses some XML and creates some controls (programmatically, in the code-behind), with some of the controls being Images and MediaElements (although the MediaElements are displaying images). The application works fine on Windows 7, but when I move it over to any machine running XP, it throws no exceptions or anything, but does not show the images. Does anyone know what's going on here?

Thanks in advance.

-Zane Kaminski



If it's worth anything to say, the images are all bitmaps.


dears , in sql 2005 table i created an image column

in that image colum i inserted an image in hex format. data like as follows.


this image i can view in an sql image viewer.Bit when i try to open this image in an aspx page using the code below,that time pisture box is coming with a cross icon.nothing is displaying.

y this pblem is happening?in sql image viewer he picture is showing.the code i used is as follows

Const SQL As String = "SELECT [MIMEType], [Image] FROM [PictureTable] WHERE [ImageID] =86"

            Dim myCommand As New SqlCommand(SQL, myConnection)
            myCommand.Parameters.AddWithValue("@ImageID", ImageID)

            Dim myReader As SqlDataReader = myCommand.ExecuteReader

            If myReader.Read Then
                Response.ContentType = myReader("MIMEType").ToString()
            End If


This is quite a difficult bug to explain. Basically when you go to upload an image and save, when you then log out of that page and go into a completely different login and click to upload an image then the picture from the child you were on previously is showing. it should not be happening
shows extra lines around the image

I am working with two different 'rounded corner' images and I am getting an extra line at the top of the smaller image.  The first image, headerborder_corner_tl_3.png, is 25 x 25.  This image diplays correctly in the first <div> below. 

The second image, pageborder_corner_tl_4.png, is 15 x 15.  In the second <div> below, the image gets displayed with an extra line at the top of the image.  But if I comment out the second <td>  (as I do in the third <div>) the image displays correctly.

Looking at the second div, can someone shed some light on what might be causing the image to be displayed with an extra line above it...or why it displays correctly when I comment out the second <td>?

        <table bgcolor="#F6AD2C" cellpadding="0" cellspacing="0" align="center">
                <td width="25" height="25">
                    <img src="<%= Page.ResolveUrl("~")%>Images/headerborder_corner_tl_3.png" alt="topLeftOuter" />
                <td> </td>             
        <table bgcolor="#2E8A3F" cellpadding="0" cellspacing="0" align="center">
                <td width="15" height="15">
                    <img src="<%= Page.ResolveUrl("~")%>Images/pageborder_corner_tl_4.png" alt="topLeftOuter" />
                <td> </td>
        <table bgcolor="#2E8A3F" cellpadding="0" cellspacing="0" align="center">
                <td width="15" height="15">
                    <img src="<%= Page.ResolveUrl("~")%>Images/pageborder_corner_tl_4.png" alt="topLeftOuter"/>
                <%--<td> </td>--%>



I have a pictorial representation of an human image and in that image i have  several points


By clicking in the grayed circle and i need to show an popup window that need to select either as

1)Active Access Green as shown in fig

2)Inactive as Red

3)Maturing as Yellow

 i need that fill that selectable grayed circle as which selected from the above three

and need show that color on that

Image formats for ReportViewer 2008
I can only view a Jpeg format on Windows 7 while the JPG views on Vista. Have not tried PNG or BMP but assume they will view correctly.

The MS support webpages seem to contradict each other and I do not know if I can use both the JPEG and JPG formats or just one.

Please clarify this for me.

On webpage:http://msdn.microsoft.com/en-us/library/ms251712(v=VS.90).aspx
It states that the JPEG format is ok to use.
"Image is used to display binary image data in a report. You can use external, embedded, or database images in .bmp, .jpeg, .gif, and .png formats. 
For information, see Adding an Image." So here it appears that all of the above formats are available.

On the link you then click--> "See adding and image" the JPG format is only used and not JPEG or GIF.


"Using an External or Database Image to a Report
To use a database image, you can specify the database field that contains the image as long as the MIME type is JPG, PNG, or BMP. 
If the image is stored as a binary object, you must write an expression that converts the image to a supported type."

And on the link above it appears to have narrowed
the formats down.


I am modifying the article page layout to display more than one image. The rendered page does not show the image. Its showing the <img> tag instead.

Please help!


Hi, could anyone help?

as the title, Thanks very much for help. 


I have a Sharepoint blog that is set up to receive email posts. I sent an email with an embedded image. The email was received and properly turned into a post with a place marker for the image. However , the image was not processed properly and it showed up blank in the post.

Anybody have and ideas?


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure