473,766 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3337
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.Redire ct, I think.

Dale Preston
MCAD, MCSE, MCDBA
"Dune" <Du**@discussio ns.microsoft.co m> wrote in message
news:0B******** *************** ***********@mic rosoft.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
9424
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 App/Options tab. The include files are being called as <!-- #include virtual="../includes/file.inc" --> <!-- #include virtual="../includes/script.asp" --> If I remove the parent path call it works just fine. I
24
7427
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 Server.MapPath() error 'ASP 0175 : 80004005' Disallowed Path Characters /backend/_add_two.asp, line 103
7
3684
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 ("Root/Files/../Config/"). 'Config' is a virtual directory under 'Root' which is also a virtual directory. 'Files' is a normal folder. Under IIS 5.0, the path is correctly mapped to the local path of the
3
6877
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 correct, i.e. enable parent paths, etc. and still get these errors: Server object error 'ASP 0228 : 80004005' Server.Execute Error /ASP_Procedures/PageHeader.asp, line 60 The call to Server.Execute failed while loading the page.
7
2361
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, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages. I've had a problem separating them from the intranet HTML and ASP pages, which is...
3
1984
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 so far failed. I'm creating a PHP site that will run on IIS (not my choice, so please don't just say "use Apache"), and I want to implement a virtual directory system to allow multiple "installations" that use a single code location.
7
3391
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 folder for my webApp is not situated in Inetpub, nor is the DATA folder that I would like to retrieve
3
1523
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 stored in C:\Inetpub\wwwroot\ but somewhere else. But the VIRTUAL command let IIS locate files by the IIS virtual folder. Now in ASP.NET this does not work. It complains saying:
7
3210
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"); Fso.MoveFile(Server.MapPath("1.jpg"),(Server.MapPath("2.jpg")); but it does not work properly when I use the the code in my local system it also not worked. But when I put full filepathpath instead of mapPath in my local system. Like
0
9568
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7381
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.