server.transfer scope

C

Craig Banks

I have 2 ASP.Net solutions/projects. I want to use Server.Transfer in one
solution/project to call the aspx webform in the second solution/project.
When I try it I get an error message. My call is straightforward:

Server.Transfer("/ServerTransferUtility/Server.aspx")

The call finds my target page but errors out on its first line:

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="Server.aspx.vb" Inherits="ServerTransferUtility.Henrico.Server"
%>

The inner generated is: "Parser Error: Could not load type
'ServerTransferUtility.Henrico.Server'." This is the error spewed out in the
browser window. The other error generated in the client page's code-behind
page is: "Error executing child request for
/ServerTransferUtility/Server.aspx" which is thrown as a result of the first
error.

Any clues on how I can work through this problem? Searching around I've
picked up some hints that Server.Transfer may be restricted to an
"application" level scope though the reason for this restriction isn't
intuitively obvious.

Thanks in advance for your help.
 
K

Kumar Reddi

Well the reason could be as you mentioned, Server.transfer is application
level scope. When you do Server.Transfer, I guess asp.net executes the
target webform and returns the result to the browser. In .NET each
application is run under its own application domain. I think Server.Transfer
is restricted to application level scope, because one application domain can
not access the code of another application domain.Where as
Response.Redirect, involves two round trips, the second one does a HTTP Get
request. So, you can do Response.Redirect without any restrictions
 

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

Top