Server.Transfer("myPage.aspx") : error executing child request

  • Thread starter Thread starter Tim C.
  • Start date Start date
T

Tim C.

I get the error "error executing child request" when I
use the Server.Transfer method to invoke a second aspx
page. The following code is executed in a LinkButton click
eventhandler on Page1.aspx.

Server.Transfer("Page2.aspx",True)

This code is virtually identical to the examples in
chapter 4 (p. 196) of Microsoft's _Developing Web
Applications_ 2nd edition, by Jeff Web. For what I'm
hoping to accomplish, the Transfer method would work out
better than Response.Redirect().

The two ASPX pages in question are in the same folder. In
the Page directive for Page1.aspx, EnableViewStateMac is
set to "false".

I don't understand why the error. Any help would be
appreciated.

Thanks
 
You need to set "EnableViewStateMac" to "false" on Page2 instead of
Page1.

By default, "EnableViewStateMac" is "true", and when Page2 loads the
viewstate from Page1, it detected that is is not generated from
itself, and thus return an error.

Tommy,
 
Back
Top