Assuming vbscript
:
Unfortunately, VBScript doesn't have the error trapping capabilities of VB.
So, you can't just do a "on error GOTO SOMEWHERE" and have "exit sub" at the
somewhere label. But you can do:
On Error Resume Next
If Err.Number <> 0 Then Exit Sub
Example:
page1.asp:
<%
server.execute "page2.asp"
response.write "<br>page 2 was executed."
%>
page2.asp:
<%
Call Main()
Sub Main()
on error resume next
response.write "test line 1<br>"
x = 1/0
If err.number <> 0 Then Exit Sub
response.write "test line2"
End Sub
%>
Ray at work
"JT" <je******@sppinc.net> wrote in message
news:u4**************@TK2MSFTNGP10.phx.gbl...
thanks for the reply - what is the code to halt an executed page?
for example, if i encounter an error on the executed page, i want to stop
the execution and bounce back to the calling page.
something like RETURN???
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:#0**************@TK2MSFTNGP11.phx.gbl... Only if you include code in the page that you're executing to have it
halt in there. What criteria are you using to decide whether or not you'd
like the code to continue?
Ray at work
"JT" <je******@sppinc.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl... is it possible to somehow "jump out of" an ASP page that is executed from another page via the Server.Execute method?
on the page being executed i have several instances where i need to
stop the execution and immediately shoot back to the calling page without
running through the rest of the code on the executed page.
im not sure if this is possible but any help would be much
appreciated.
tia
jt