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

PopUp's

Status
Not open for further replies.

shawnhevel

Programmer
Jun 23, 2004
8
US
I've got the following code that will open a popup as a progress meter.

response.Write("<script LANGUAGE=""VBScript"">" & vbCrLf)
response.Write("<!--" & vbCrLf)
response.Write("config = ""toolbar=no,location=no,directories=no,status=no,menubar=no,width=400,height=100,top=400,left=250 scrollbars=no,resizeable=no""" & vbCrLf)
response.Write("set objNewPop = window.open("""", ""pop"", config)" & vbCrLf)
response.Write("set objNewDoc = objNewPop.Document" & vbCrLf)
response.Write("objNewDoc.open()" & vbCrLf)
response.Write("objNewDoc.write(""<html>"")" & vbCrLf)
response.Write("objNewDoc.write(""<title='PDF Generations'>"")" & vbCrLf)
response.Write("objNewDoc.write(""<center>"")" & vbCrLf)
response.Write("objNewDoc.write(""<font tahoma color='blue'><b>"")" & vbCrLf)
response.Write("objNewDoc.write(""" & strProgress & """)" & vbCrLf)
response.Write("objNewDoc.write(""<img border='0' src='../images/processing.gif'>"")" & vbCrLf)
response.Write("objNewDoc.write(""</b></font>"")" & vbCrLf)
response.Write("objNewDoc.write(""</html>"")" & vbCrLf)
response.Write("objNewDoc.close()" & vbCrLf)
response.Write("-->" & vbCrLf)
response.Write("</script>" & vbCrLf)



When using IE7, this code will execute and open up a new tab. Is there a way to change the code to open up a small window that lets the user know their progress for the current request they've made? What I'm after is a popup and not a new tab being opened up?

Has anyone ran across a solution for this?

Thanks for your help.
 
Thanks, I will look into this. My question is have you tested this code with IE7 (Internet Explorer 7). The reason I'm asking is you said to specify the window size. Don't I do that above with the following line:

config = ""toolbar=no,location=no,directories=no,status=no,
menubar=no,width=400,height=100,top=400,left=250 scrollbars=no,resizeable=no""" & vbCrLf

Thanks for your help.

Shawn
 
Yes, I am running Vista RC2 with IE7 and have my default behavior set to open Windows in new TABS but executing my code opens in a new tiny window. Refer back to my code, the key is the about:blank which says to use a new window.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
Mark,

Could you check something out?

I've coded my application as follow, using your logic:


response.Write(vbCrLf & "<script LANGUAGE=""VBScript"">" & vbCrLf)
response.Write("<!--" & vbCrLf)
response.Write("TestCondition = """"" & vbCrLf)
response.Write("stage = 1" & vbCrLf)
response.Write("Do" & vbCrLf)
response.Write(" If stage > 0 Then" & vbCrLf)
response.Write(" stage = DisplayProgress(stage)" & vbCrLf)
response.Write(" End If" & vbCrLf)
response.Write("Loop While TestCondition = """"" & vbCrLf & vbCrLf)

response.Write("Function DisplayProgress(stage)" & vbCrLf)
response.Write("set x = createobject(""internetexplorer.application"")" & vbCrLf)
response.Write("x.navigate2 ""about:blank"" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = True" & vbCrLf)

response.Write("x.document.write ""<font color=blue>""" & vbCrLf)
response.Write("For n = 1 to 100" & vbCrLf)
response.Write(" x.document.write ""|""" & vbCrLf)
response.Write(" wscript.sleep 50" & vbCrLf)
response.Write(" x.document.title = ""Stage "" & stage & "" "" & n & "" %""" & vbCrLf)
response.Write("Next" & vbCrLf)
response.Write("stage = stage + 1" & vbCrLf)

response.Write("x.quit" & vbCrLf)
response.Write("set x = nothing" & vbCrLf)
response.Write("DisplayProgress = stage" & vbCrLf)

response.Write("End Function" & vbCrLf)
response.Write("-->" & vbCrLf)
response.Write("</script>" & vbCrLf & vbCrLf)
response.Write("<li><font face=arial size=2 color=navy><b>" & pstrDocumentBeingProcessed & "</b></font></li><br>")
response.Flush()

When I run the website, I a "error on page" message at the bottom of the screen. Here is what the view source looks like:

<font face=arial size=4 color=navy><b>Creating Document Package...</b></font><br><br><blockquote>
<script LANGUAGE="VBScript">
<!--
TestCondition = ""
stage = 1
Do
If stage > 0 Then
stage = DisplayProgress(stage)
End If
Loop While TestCondition = ""

Function DisplayProgress(stage)
set x = createobject("internetexplorer.application")
x.navigate2 "about:blank" : x.width = 350 : x.height = 80 : x.toolbar = false : x.menubar = false : x.statusbar = false : x.visible = True
x.document.write "<font color=blue>"
For n = 1 to 100
x.document.write "|"
wscript.sleep 50
x.document.title = "Stage " & stage & " " & n & " %"
Next
stage = stage + 1
x.quit
set x = nothing
DisplayProgress = stage
End Function
-->
</script>

<li><font face=arial size=2 color=navy><b>Generating Insurance Application Main Page<br><font color=#006400><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Binding Category :&nbsp;&nbsp;Binding with Liability Limits<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Company&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;Mutual</font></b></b></font></li><br>


Do you see anything wrong with how I've coded this?

Thanks,
 
How are you implementing this? Why are you converting this to response.write instead of having it in a script section as I originally posted?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
I'm running it in a dotnet application. What I'm doing is creating pdf documents from an rtf document. I show the user at each stage which piece of the entire document package is being created. Currently, I'm embedding the progress meter script into the web page (see my first post).

I'm not sure how to run as a script any other way then this.

Does this make sense?

Here is what the source looks like behind the page, currently:

<font face=arial size=4 color=navy><b>Creating Document Package...</b></font><br><br><blockquote><script LANGUAGE="VBScript">
<!--
config = "toolbar=no,location=no,directories=no,status=no,menubar=no,width=400,height=100,top=400,left=250 scrollbars=no,resizeable=no"
set objNewPop = window.open("", "pop", config)
set objNewDoc = objNewPop.Document
objNewDoc.open()
objNewDoc.write("<html>")
objNewDoc.write("<title='PDF Generations'>")
objNewDoc.write("<center>")
objNewDoc.write("<font tahoma color='blue'><b>")
objNewDoc.write("Your request is being processed.<br>12% complete.<br>")
objNewDoc.write("<img border='0' src='../images/processing.gif'>")
objNewDoc.write("</b></font>")
objNewDoc.write("</html>")
objNewDoc.close()
-->
</script>
<li><font face=arial size=2 color=navy><b>Generating Insurance Application Main Page<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Policy:<font new size=3 color=#8B0000><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AU 3002114</b></font><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Insured:<font new size=3 color=#8B0000><b>&nbsp;&nbsp;&nbsp;Ashely T Booth</b></font></b></font></li><br>
 
Why don't you try an alternate method. Take my code and save it to a file. Then within your application simply call it up and terminate it when you are ready? Seems you are trying to build it on the fly when you don't necessarily need to. Does that make sense?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
I have a question. I've never run a vbscript file from a dotnet web application. Any idea as to how to run this?

I did create a file call DisplayProgressMeter.vbs in my web application. I know how to read the contents of the file, but how do you execute it?

Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top