Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Vbscript to refresh current page

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,55842
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vbscript to refresh current page
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Vbscript to refresh current page - 1/22/2008 8:08:08 PM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi,
I need help please!
I need a script to refresh the current page.
Reason being is that i had jscript tooltip in an xslt file that works fine when first time the page is loaded but once onpostback - it does not work.
So i can't edit the aspx file becuase the entire site uses the file.
So i would like to Refresh the Current ASPX/Page so that it at leats works the first time user opens page!

Please Assist!
Regards
 
 
Post #: 1
 
 RE: Vbscript to refresh current page - 1/22/2008 11:19:04 PM   
  mbouchard


Posts: 1916
Score: 16
Joined: 5/15/2003
From: USA
Status: offline
You could use send keys to send F5 to the screen to refresh the page.  You would just want to use AppActivate before sendkeys to make sure the page is active.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to ismailc)
 
 
Post #: 2
 
 RE: Vbscript to refresh current page - 1/22/2008 11:37:11 PM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, i'm a real junior & have no clue - Please help!

I'm using Flowcentric which uses vbscript.

strStUOM = "aObjects("FG1030StUOM")"
If strStUOM = "Liter" Then
   window.location.reload()
End If

I get an error: Object required: 'window'

I really like the idea of a F5 (Refresh) but unfortunately i have no clue how & what to do!

Can you please help by providing code of the AppActivate & sendkeys

Please!

Regards

(in reply to ismailc)
 
 
Post #: 3
 
 RE: Vbscript to refresh current page - 1/23/2008 12:05:23 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, found this code & one for noetpad but it does not like the script "Wscript"

 
'Option Explicit

Dim
WSHShell, strDesktop

Set
WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders(
"Desktop")
WSHShell.
AppActivate strDesktop
WSHShell.SendKeys
"{F5}"

WScript.Quit


Can't get it going! Please Assist!

(in reply to ismailc)
 
 
Post #: 4
 
 RE: Vbscript to refresh current page - 1/23/2008 12:30:19 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
That is because it is ASP.net which is not compatible with VBScript, but VB.net

you would need to put in at the top of the page in the <%@page tag

something like this:

Page AspCompat="true"

(in reply to ismailc)
 
 
Post #: 5
 
 RE: Vbscript to refresh current page - 1/23/2008 12:40:24 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, unfortunatley i ca''t touch the aspx file.

so i need to do it directlty ftom vscript, so i guess i'm back to:

strStUOM = "aObjects("FG1030StUOM")"
If strStUOM = "Liter" Then

   window.location.reload()

End If

Please Assist!

Regards

(in reply to twilliamsen)
 
 
Post #: 6
 
 RE: Vbscript to refresh current page - 1/23/2008 12:43:42 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
What does it say in the title bar of the page?

(in reply to ismailc)
 
 
Post #: 7
 
 RE: Vbscript to refresh current page - 1/23/2008 12:50:19 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Home - Microsoft Internet Explorer

Hope this is what was needed!

(in reply to twilliamsen)
 
 
Post #: 8
 
 RE: Vbscript to refresh current page - 1/23/2008 12:57:46 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Try this:


      

If you want it to keep refreshing, so you don't need to keep firing off the VBS file, put it into a loop


(in reply to ismailc)
 
 
Post #: 9
 
 RE: Vbscript to refresh current page - 1/23/2008 1:06:33 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, 

I really appreciate the help & very gratefull as you are my only hope to get this going!

It does not load the page - it gives an error: Invalid character
 
 
Please Assist!

(in reply to twilliamsen)
 
 
Post #: 10
 
 RE: Vbscript to refresh current page - 1/23/2008 1:10:14 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
What error does it give a line#?

(in reply to ismailc)
 
 
Post #: 11
 
 RE: Vbscript to refresh current page - 1/23/2008 1:16:06 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
Found it...


      

(in reply to twilliamsen)
 
 
Post #: 12
 
 RE: Vbscript to refresh current page - 1/23/2008 1:16:36 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Unfortunately Flowcentric does not give detailed errors

The FG101009Object is where the script is in.





A scripting error has occurred in FG101009Object: Invalid character. For further details please check the event log.

(in reply to twilliamsen)
 
 
Post #: 13
 
 RE: Vbscript to refresh current page - 1/23/2008 1:19:46 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
use notepad and save it as a VBS file

(in reply to ismailc)
 
 
Post #: 14
 
 RE: Vbscript to refresh current page - 1/23/2008 1:41:08 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, i think we are nearly there: i've had it to a file.

set oWSH = wscript.CreateObject("Wscript.Shell")
set Hme = "Home - Microsoft Internet Explorer"
'set Hme = "myProcessItem - Microsoft Internet Explorer"
oWSH.appActivate(Hme)
wscript.sleep 500
wscript.SendKeys "{F5}"

Error:
Line: 2
Char: 2
Error: Object required: '[string: "Home - Microsoft Int"]'
code: 800A01A8


Please Assist!

Regards


(in reply to twilliamsen)
 
 
Post #: 15
 
 RE: Vbscript to refresh current page - 1/23/2008 1:43:48 AM   
  twilliamsen

 

Posts: 195
Score: 0
Joined: 1/18/2007
Status: offline
remove set from hme

(in reply to ismailc)
 
 
Post #: 16
 
 RE: Vbscript to refresh current page - 1/23/2008 1:44:04 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
This is the code that you posted:

set oWSH = wscript.CreateObject("Wscript.Shell")
set Hme = "Home - Microsoft Internet Explorer"
'set Hme = "myProcessItem - Microsoft Internet Explorer"
oWSH.appActivate(Hme)
wscript.sleep 500
wscript.SendKeys "{F5}"


Notice that this line is commented out:

'set Hme = "myProcessItem - Microsoft Internet Explorer"

The error you are getting is exactly the error that you would get if that line was not commented out. Are you sure that you are running what you posted?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ismailc)
 
 
Post #: 17
 
 RE: Vbscript to refresh current page - 1/23/2008 1:55:25 AM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi, I noticed when i'm in the task it's the other page:

set oWSH = wscript.CreateObject("Wscript.Shell")
set Hme = "Home - Microsoft Internet Explorer"
oWSH.appActivate(Hme)
wscript.sleep 500
wscript.SendKeys "{F5}"


Exactly the same error!

Please Assist!

(in reply to ebgreen)
 
 
Post #: 18
 
 RE: Vbscript to refresh current page - 1/23/2008 1:57:08 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
Change this:

set Hme = "Home - Microsoft Internet Explorer"

to this:

Hme = "Home - Microsoft Internet Explorer"

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ismailc)
 
 
Post #: 19
 
 RE: Vbscript to refresh current page - 1/23/2008 5:25:47 PM   
  ismailc

 

Posts: 36
Score: 0
Joined: 10/17/2007
Status: offline
Hi,

Sorry for yesterday afternoon as i forgot to inform you i was going home.

I get another error:

set oWSH = wscript.CreateObject("Wscript.Shell")
Hme = "Home - Microsoft Internet Explorer"
oWSH.appActivate(Hme)
wscript.sleep 500
wscript.SendKeys "{F5}"

Error:

Line: 5
Error: Object doesn't surpport this property or method: 'wscript.SendKeys'

Please Assist!

Regards



(in reply to ebgreen)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Vbscript to refresh current page Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts