473,386 Members | 1,708 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,386 software developers and data experts.

server.execute and virtual paths

I'm trying to execute an aspx page by calling Server.Execute.

The aspx page I'm trying to execute is in a different web app from the aspx page containing the Server.Execute statement. A slightly clearer explanation...

Page1 exists in WebApp1. In the code-behind of Page2 in WebApp2, I have put Server.Execute("Path to Page1 in WebApp1").

When I call Server.Execute(String) using "http://localhost/WebApp1/Page1.aspx", everything works ok and Page1 pops up in a new window.

But when I try to use the same path with the overloaded version, Server.Execute(String, TextWriter), I get an error saying I must pass in a virtual path. So I pass in "../WebApp1/Page1.aspx" as the path. But now I get this error:

The virtual path '/WebApp1/Page1.aspx.cs' maps to another application, which is not allowed.

But I can execute the same page using Server.Execute(String) and "http://..."!!

So, is my virtual path wrong? Or is it something else?
(I need to use the overloaded version Server.Execute(String, TextWriter) so that I can capture the output from Page1 and NOT have it popup in a new window.)

Nov 18 '05 #1
2 3309
Hmmm, sorry peoples...

Forget my first post...it seems my dlls weren't recompiling correctly and Server.Execute(String) plus "http://..." seemed to work cos it was using some old code but in fact that doesn't work.

So, it seems I can't use Server.Execute to execute pages in another web app.
Is there another way to accomplish this?

Cheers, Dune

"Dune" wrote:
I'm trying to execute an aspx page by calling Server.Execute.

The aspx page I'm trying to execute is in a different web app from the aspx page containing the Server.Execute statement. A slightly clearer explanation...

Page1 exists in WebApp1. In the code-behind of Page2 in WebApp2, I have put Server.Execute("Path to Page1 in WebApp1").

When I call Server.Execute(String) using "http://localhost/WebApp1/Page1.aspx", everything works ok and Page1 pops up in a new window.

But when I try to use the same path with the overloaded version, Server.Execute(String, TextWriter), I get an error saying I must pass in a virtual path. So I pass in "../WebApp1/Page1.aspx" as the path. But now I get this error:

The virtual path '/WebApp1/Page1.aspx.cs' maps to another application, which is not allowed.

But I can execute the same page using Server.Execute(String) and "http://..."!!

So, is my virtual path wrong? Or is it something else?
(I need to use the overloaded version Server.Execute(String, TextWriter) so that I can capture the output from Page1 and NOT have it popup in a new window.)

Nov 18 '05 #2
You're going to be stuck with Response.Redirect, I think.

Dale Preston
MCAD, MCSE, MCDBA
"Dune" <Du**@discussions.microsoft.com> wrote in message
news:0B**********************************@microsof t.com...
Hmmm, sorry peoples...

Forget my first post...it seems my dlls weren't recompiling correctly and Server.Execute(String) plus "http://..." seemed to work cos it was using
some old code but in fact that doesn't work.
So, it seems I can't use Server.Execute to execute pages in another web app. Is there another way to accomplish this?

Cheers, Dune

"Dune" wrote:
I'm trying to execute an aspx page by calling Server.Execute.

The aspx page I'm trying to execute is in a different web app from the aspx page containing the Server.Execute statement. A slightly clearer
explanation...
Page1 exists in WebApp1. In the code-behind of Page2 in WebApp2, I have put Server.Execute("Path to Page1 in WebApp1").
When I call Server.Execute(String) using "http://localhost/WebApp1/Page1.aspx", everything works ok and Page1 pops up
in a new window.
But when I try to use the same path with the overloaded version, Server.Execute(String, TextWriter), I get an error saying I must pass in a
virtual path. So I pass in "../WebApp1/Page1.aspx" as the path. But now I
get this error:
The virtual path '/WebApp1/Page1.aspx.cs' maps to another application, which is not allowed.
But I can execute the same page using Server.Execute(String) and "http://..."!!
So, is my virtual path wrong? Or is it something else?
(I need to use the overloaded version Server.Execute(String, TextWriter) so that I can capture the output from Page1 and NOT have it popup in a new
window.)

Nov 18 '05 #3

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

Similar topics

9
by: JR | last post by:
Hi, I'm migrating my website to an IIS 6.0 server and all the asp pages work fine except for the ones that reference include files, even though I have "Enable parent paths" enabled in the...
24
by: Lovely Angel | last post by:
Dear Friends Hope you doing great. I have recently shifted to a webhost which is Using Windows 2003 and IIS 6. Now my application was working fine earlier but now I am facing this problem ...
7
by: Elie Grouchko | last post by:
Hi I am running exactly the same ASP code on IIS 5.0 and IIS 6.0 I am calling Server.MapPath(), the parameter is a virtual path that includes a reference to a parent path...
3
by: Chris | last post by:
I have yet to understand or get a response on the issue I'm having. I'm taking an asp web application and migrating it from Windows 2K to 2003. I have the new website location (2003) settings...
7
by: laura | last post by:
I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore,...
3
by: Tom Hartland | last post by:
(Summary: is there a way to convert virtual paths to physical paths using PHP on IIS?) I hope I'm not covering old ground, but I've spent a couple of hours looking for this information and have...
7
by: benoit | last post by:
Hi, if I write this code to retrieve a folder on the server Server.mappath("/DATA") I get this error message System.InvalidOperationException: Failed to map the path '/DATA' the virtual...
3
by: Dhruba Bandopadhyay | last post by:
In classic ASP I could write: <!-- #INCLUDE VIRTUAL="Kevin\General\ServiceClass.asp" --> and it would "include" that ASP file into the current ASP file. My web application folder was not...
7
by: jain2005k | last post by:
How can I rename a .jpg file in server using asp( not asp.net) code I use the FileSystemObject to do that like Fso = Server.CreateObject("Scripting.FileSystemObject");...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.