Calling ASP from ASPX

G

gemel

I have an existing ASP application that generates an e-mail when
someone visits the page. The page uses vbscript to creazte the mail
object and then populate it.

Firstly I tried to copy the script including the <% %> into the body
of the ASPX file. No errors occurred when the page was called, but no
mail was generated.

Next I tried re-create the code in the page_load event using <script>
tags with language set to vbscript. This time an error was generated
when I called the page.

Next I isolated the orginal ASP program and called it 'mail.asp' and I
called this directly from the browser. No problem here. The e-mail was
gemerated as expected. So I thought that I might simply call
'mail.asp' from ASPX using 'server.execute("mail.asp"). Now I get a
page error stating that it occurred dring the call to a child page.

Any tips on co-existing with ASP or converting ASP to ASPX please.

John
 
K

Ken Cox [Microsoft MVP]

Hi John,

Server.Execute won't cross the boundary between ASP and ASPX.

What happens if you use

Response.Redirect("mail.asp")

?

Ken
Microsoft MVP [ASP.NET]
 
G

gemel

The problem here is that it gets messy because I want to transfer
control back to the original ASPX.

Thanks

John

Hi John,

Server.Execute won't cross the boundary between ASP and ASPX.

What happens if you use

Response.Redirect("mail.asp")

?

Ken
Microsoft MVP [ASP.NET]

gemel said:
I have an existing ASP application that generates an e-mail when
someone visits the page. The page uses vbscript to creazte the mail
object and then populate it.

Firstly I tried to copy the script including the <% %> into the body
of the ASPX file. No errors occurred when the page was called, but no
mail was generated.

Next I tried re-create the code in the page_load event using <script>
tags with language set to vbscript. This time an error was generated
when I called the page.

Next I isolated the orginal ASP program and called it 'mail.asp' and I
called this directly from the browser. No problem here. The e-mail was
gemerated as expected. So I thought that I might simply call
'mail.asp' from ASPX using 'server.execute("mail.asp"). Now I get a
page error stating that it occurred dring the call to a child page.

Any tips on co-existing with ASP or converting ASP to ASPX please.

John
 
G

Guest

Perhaps you can pass the name of the originating page in on the query string so it knows where to go back?

response.redirect("myasppg.asp?pg=origaspx.aspx")



gemel said:
The problem here is that it gets messy because I want to transfer
control back to the original ASPX.

Thanks

John

Hi John,

Server.Execute won't cross the boundary between ASP and ASPX.

What happens if you use

Response.Redirect("mail.asp")

?

Ken
Microsoft MVP [ASP.NET]

gemel said:
I have an existing ASP application that generates an e-mail when
someone visits the page. The page uses vbscript to creazte the mail
object and then populate it.

Firstly I tried to copy the script including the <% %> into the body
of the ASPX file. No errors occurred when the page was called, but no
mail was generated.

Next I tried re-create the code in the page_load event using <script>
tags with language set to vbscript. This time an error was generated
when I called the page.

Next I isolated the orginal ASP program and called it 'mail.asp' and I
called this directly from the browser. No problem here. The e-mail was
gemerated as expected. So I thought that I might simply call
'mail.asp' from ASPX using 'server.execute("mail.asp"). Now I get a
page error stating that it occurred dring the call to a child page.

Any tips on co-existing with ASP or converting ASP to ASPX please.

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top