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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window.Open Question

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
0
0
US
I am using the window.open function to run some reports using crystal. Some of these reports are large. How can I display a message or something telling the user "Processing Report..Please Wait"

Right now the window opens blank until the report gets populated.

any help would be appreciated..

thanks

Dim strRedirect As String

strRedirect = "../ReportsMenu/ReportName.aspx"
Response.Write("<script language='javascript'>" & vbCrLf)
Response.Write("wndcht=window.open('" + strRedirect + "','_new', 'toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,left=0,top=0');")
Response.Write("<" & "/" & "script" & ">" & vbCrLf)

 
You should just be able to display a please wait message as you would do with any standard HTML page (i.e. with a mixture of javascript and CSS)


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I tried
Response.Write("wndcht=window.load = function () {alert('Please Wait!');}")

Can't get this to fire off..

 
I suggest, instead of a popup, to have a label on the page that says "Pleas wait, retrieving data ..." Then once the report loads, set the label to visible = FALSE.

Jim
 
Also have a look at the Response.Flush() method of .NET

Known is handfull, Unknown is worldfull
 
You shouldn't use Response.Write to write data out to your page (unless you are testing). If you search google for "Please Wait Javascript CSS" you will get lots of simple examples on how to do it, such as:



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Yes, using Response.Write() is an improper,

but i guess thats the only way to display the preliminary message.

i wrote a small ASPX file:
Code:
<%@ import namespace="System.Threading"%>
<script runat="server">
	sub page_load
		response.write("ASD")
		response.Flush()
		Thread.Sleep(5000)
	end sub
</script>

<!-- ONE STEP TO INSTALL PRE-LOADING MESSAGE:



  1.  Copy the coding into the HEAD of your HTML document  -->



<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->



<HEAD>



<style type="text/css">

<!--

#loading {

	width: 200px;

	height: 100px;

	background-color: #c0c0c0;

	position: absolute;

	left: 50%;

	top: 50%;

	margin-top: -50px;

	margin-left: -100px;

	text-align: center;

}

-->

</style>



<script type="text/javascript">

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! [URL unfurl="true"]http://javascript.internet.com[/URL] -->

<!-- Created by: Robert Paulson : [URL unfurl="true"]http://www.abrahamjoffe.com.au/[/URL] -->

<!-- Begin

document.write('<div id="loading"><br><br>Please wait...</div>');

window.onload=function(){

	document.getElementById("loading").style.display="none";

}

// End -->

</script>





<p><center>

<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>

by <a href="[URL unfurl="true"]http://javascriptsource.com">The[/URL] JavaScript Source</a></font>

</center><p>


<!-- Script Size:  0.93 KB -->

If u notice the CSS loading NEVER comes, thats cause the Javascript coding itself is outputted only at the end of execution (.NET always outputs ALL html together)...

Known is handfull, Unknown is worldfull
 
Another alternative is to redirect the user to a holding page and only forward them onto the relevant page once the processing has finished. e.g.



____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks for the info guys..I will look at these links etc.

Again, Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top