473,406 Members | 2,281 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

stop server.execute in the middle

JT
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
Jul 19 '05 #1
6 3527
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

Jul 19 '05 #2
JT
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


Jul 19 '05 #3
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



Jul 19 '05 #4
JT
but im not executing a sub - im executing an ASP page.

your advice would work if i were using 'includes' rather than server.execute

i tried making the asp page called by the server.execute a subroutine - but
when i do this, it doesn't get executed???

for this case i want to avoid using an includes file

i must be misunderstanding something b/c this seems like it should be so
simple

thanks again
jt

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
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
>
>



Jul 19 '05 #5
You could just encapsulate your code in a sub and call it at the top of the
page.

Ray at work

"JT" <je******@sppinc.net> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
but im not executing a sub - im executing an ASP page.

your advice would work if i were using 'includes' rather than server.execute
i tried making the asp page called by the server.execute a subroutine - but when i do this, it doesn't get executed???

for this case i want to avoid using an includes file

i must be misunderstanding something b/c this seems like it should be so
simple

thanks again
jt

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
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
> >
> >
>
>



Jul 19 '05 #6
JT
ok sorry silly me i think i got it now

i made my executed page into a subroutine but i forgot to add a call to the
subroutine

asp1.asp :

Server.Execute("../asp2.asp")
asp2.asp :

Call AddPayment()

Sub AddPayment()

if error = true then
exit sub
end if

do something else

End Sub

thanks for the help
jt
"JT" <je******@sppinc.net> wrote in message
news:uS**************@tk2msftngp13.phx.gbl...
but im not executing a sub - im executing an ASP page.

your advice would work if i were using 'includes' rather than server.execute
i tried making the asp page called by the server.execute a subroutine - but when i do this, it doesn't get executed???

for this case i want to avoid using an includes file

i must be misunderstanding something b/c this seems like it should be so
simple

thanks again
jt

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eY**************@TK2MSFTNGP11.phx.gbl...
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
> >
> >
>
>



Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: lawrence | last post by:
Suppose I create dynamic web pages with 3 functions (which call other functions to make everything happen, but these 3 you might think of as being the top layer): registerSessions();...
4
by: Nikhil Patel | last post by:
Hi all, I am using windows authentication to create a sql connection using following connection string stored in web.config. <add key="GoldmineConnectString" value="server=(local);initial...
5
by: Guadala Harry | last post by:
I've been reading up on Server.Transfer as well as doing some testing, and it appears to always raise the ThreadAbortException error. On one hand I've read a bunch of promotional-type material...
4
by: James Radke | last post by:
Hello, I am attempting to use the proper Try/Catch technique when accessing my Microsoft SQL server database and have a question... If I use something similar to the following: Try set up...
1
by: Good Man | last post by:
Hi there I've noticed some very weird things happening with my current MySQL setup on my XP Laptop, a development machine. For a while, I have been trying to get the MySQL cache to work....
3
by: ohnoonho | last post by:
Hello, I posted this in the C# group but thought maybe the better place would be here since it is happening with website projects so please forgive any cross posting. In my website projects I...
0
by: Emanuele | last post by:
I have write a program using MS Visual studio C++ 7.0 (platform Windows XP professional). I'm not using .NET. This program save data in a SQL server 2000 database using ADO. Everything works...
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, I am thinking about doing this since I got several cases that some of our internal users open more than one browser at the same time from our server. When one of the transactions was not...
1
by: sunilkds | last post by:
In my project it has lot of code to execute,so it will take some time to get result.So i want stop in middle of execution and to come normal position. Is there any keyword in vb6 to stop execution...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.