Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with "Please Wait" function.

Status
Not open for further replies.

DarkWorlds

Technical User
Jul 20, 2005
64
US
The site I’m working on gets a local list, and then has to compare it to a list on a server elsewhere. So time will be taken up. So I wanted to implement a "Please Wait" thing.

My current setup seems to work fine. I get the “Please Wait” but it still goes after the operation is complete. That’s where the problem lays.

All the code the "Please Wait" can be seen here:

Code:
<span onclick="busyBox.Show();"><asp:button id="btnDownload" runat="server" Text="Download File"></asp:button></P>
			</SPAN><iframe id="BusyBoxIFrame" ondrop="return false;" name="BusyBoxIFrame" frameBorder="0" scrolling="no">
			</iframe>
			<SCRIPT>
				var busyBox = new BusyBox("BusyBoxIFrame", "busyBox", 4, "gears_ani_", ".gif", 125, 147, 207);
			</SCRIPT>

Thats the code im using in the HTML section.

As for whats calling it, its a button. When the button is hit, dataset is created. After the dataset is created it then is sent to the following code to be made into an excel file

Code:
		public static void ExcelConvert(DataSet ds, HttpResponse response) 
		{ 
			string startDate = System.DateTime.Today.ToShortDateString();
			string endDate = System.DateTime.Today.AddDays(7).ToShortDateString();

			response.Clear(); 
			response.Charset = ""; 
			response.ContentType = "application/vnd.ms-excel"; 
			StringWriter stringWrite = new StringWriter(); 
			HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); 
			DataGrid dg = new DataGrid(); 
			dg.DataSource = ds.Tables[0]; 
			dg.DataBind(); 
			dg.RenderControl(htmlWrite); 
			response.Write("This list is good from " + startDate + " to " + endDate);
			//response.Write(" ");
			response.Write(stringWrite.ToString()); 
			response.End(); 
		}

So you get the option to save it or open it. The problem is that the operation is complete but the "please wait" is still going on. The only way to stop it is the refresh the page, or kill it. It’s like the please wait thing doesn’t get the single that the process is complete.

I look forward to your responses.
 
I don't see anywhere in your code where you call a function that tells the javascript that the process has ended. You need to call another js script to remove the gif for Iframe.
 
java is very new to me, as is asp.net

I followed the guide, it said nothing of "stoping it". But I will take your word for it, how would I stop this then?
 
Look in the example you got this code from .. there is a StopAnimate function.
 
I see it in the java file its self, and I see it within the code of the demo.

But its to kill it via a link. How would I have this happen when the download is complete?

I know I am missing something plainly in site I am sure. Java and asp has never mixed well with me. Thats why I was hoping a demo as clear cut as that one would help, sadly not.

I look forward to your responce.
 
Well I can get it to stop via a seperate button, but this doesnt help the cause much.

Anyone got any ideas?
 
Well I have found ways to stop it, but all at the wrong times or way. I know someone in this forum has to have more brains on the subject than I do. I know im missing something, would someone point it out please.

Or atleast point me in a direction that I can do something similar?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top