Calling ASP from ASPX

  • Thread starter Thread starter gemel
  • Start date Start date
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
 
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]
 
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
 
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
 
Back
Top