469,889 Members | 1,120 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,889 developers. It's quick & easy.

Server.Transfer From App1 to App2

Hello,

We have two applications that will reside on the same webserver.

We want to be able to post from pages in App1 to to pages in App2.

We need to pass sensible data, so we cannot use querystring.

We are using server.transfer (needing to reference App2 in App1).

When we call a page in App2 from App1, the ApplicationDomain doesn´t
change when page in App2 loads, being this the one of App1.

When we try to post on the loaded page of App2, we get an execption of
invalid viewstate.

HttpException (0x80004005): El valor de viewstate no es válido para
esta página y puede estar dañado.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423

Is this approach of using server.transfer valid between applications
(web projects)?

Or can you only use it in the same application domain?

Thanks for any guiadance or help.

Manuel
Nov 18 '05 #1
3 1951
As far as I know, Server.Transfer cannot be used between different web
applications.

"Manuel Lopez" <mc*****@terra.es> wrote in message
news:cd*************************@posting.google.co m...
Hello,

We have two applications that will reside on the same webserver.

We want to be able to post from pages in App1 to to pages in App2.

We need to pass sensible data, so we cannot use querystring.

We are using server.transfer (needing to reference App2 in App1).

When we call a page in App2 from App1, the ApplicationDomain doesn´t
change when page in App2 loads, being this the one of App1.

When we try to post on the loaded page of App2, we get an execption of
invalid viewstate.

HttpException (0x80004005): El valor de viewstate no es válido para
esta página y puede estar dañado.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium()
System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423

Is this approach of using server.transfer valid between applications
(web projects)?

Or can you only use it in the same application domain?

Thanks for any guiadance or help.

Manuel

Nov 18 '05 #2
Hello Troy,

Yes can do a server.transfer to another page , as long as
you reference the dll that contains the codebehind of the
destination page.

The problem is that the application domain of the
destination page is not started, it uses application
domain of the caller page.

So once the destination page is loaded and you try to do
something, you get the invalid viewstate.

This is a big contraint, since you generally have quite a
few web apps that belong to the same webserver and need to
share context between them.

Not to mention that if you are sharing user controls, (by
having virtual directories to destination folder on all
web apps), server.transfer doesn´t work because it
considers that the shared user controls belong to another
application.

I really don´t know what to do???

-----Original Message-----
As far as I know, Server.Transfer cannot be used between different webapplications.

"Manuel Lopez" <mc*****@terra.es> wrote in message
news:cd*************************@posting.google.c om...
Hello,

We have two applications that will reside on the same webserver.
We want to be able to post from pages in App1 to to pages in App2.
We need to pass sensible data, so we cannot use querystring.
We are using server.transfer (needing to reference App2 in App1).
When we call a page in App2 from App1, the ApplicationDomain doesn´t change when page in App2 loads, being this the one of App1.
When we try to post on the loaded page of App2, we get an execption of invalid viewstate.

HttpException (0x80004005): El valor de viewstate no es válido para esta página y puede estar dañado.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium () System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423

Is this approach of using server.transfer valid between applications (web projects)?

Or can you only use it in the same application domain?

Thanks for any guiadance or help.

Manuel

.

Nov 18 '05 #3
Hi, Manuel,

I agree that AppDomain is the real problem here. Usually we don't share
context between web apps. If you really want to do that, maybe it is not a
good idea to maintain context state at the server-side. Have a try to save
viewstate at client side using cookies or something else and use
Response.Redirect() to navigate to another page which belongs to another web
app. I am not sure if viewstate will be correctly maintained through this
kind of redirection since even MSDN documents haven't mentioned that. Good
luck!

Troy

"Manuel" <mc*****@terra.es> wrote in message
news:08****************************@phx.gbl...
Hello Troy,

Yes can do a server.transfer to another page , as long as
you reference the dll that contains the codebehind of the
destination page.

The problem is that the application domain of the
destination page is not started, it uses application
domain of the caller page.

So once the destination page is loaded and you try to do
something, you get the invalid viewstate.

This is a big contraint, since you generally have quite a
few web apps that belong to the same webserver and need to
share context between them.

Not to mention that if you are sharing user controls, (by
having virtual directories to destination folder on all
web apps), server.transfer doesn´t work because it
considers that the shared user controls belong to another
application.

I really don´t know what to do???

-----Original Message-----
As far as I know, Server.Transfer cannot be used between different webapplications.

"Manuel Lopez" <mc*****@terra.es> wrote in message
news:cd*************************@posting.google.c om...
Hello,

We have two applications that will reside on the same webserver.
We want to be able to post from pages in App1 to to pages in App2.
We need to pass sensible data, so we cannot use querystring.
We are using server.transfer (needing to reference App2 in App1).
When we call a page in App2 from App1, the ApplicationDomain doesn´t change when page in App2 loads, being this the one of App1.
When we try to post on the loaded page of App2, we get an execption of invalid viewstate.

HttpException (0x80004005): El valor de viewstate no es válido para esta página y puede estar dañado.]
System.Web.UI.Page.LoadPageStateFromPersistenceMed ium () System.Web.UI.Page.LoadPageViewState()
System.Web.UI.Page.ProcessRequestMain() +423

Is this approach of using server.transfer valid between applications (web projects)?

Or can you only use it in the same application domain?

Thanks for any guiadance or help.

Manuel

.


Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Jason Shohet | last post: by
3 posts views Thread by DJT | last post: by
1 post views Thread by mg | last post: by
11 posts views Thread by Alexander Bosch | last post: by
8 posts views Thread by bryan | last post: by
3 posts views Thread by jasonheath.net | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.