Hi! I've been trying for some time now to implement the FrontController pattern that is available at the Microsoft website. Every time I call the following line of code: context.server.transfer("anypage.aspx") I get this error: Error executing child request
for anypage.aspx I've searched high and low for a solution to this problem and in no forum have I found it. My Web Application is currently working with a Page Controller type pattern, but this is not what I want. It is also getting very complicated to make
updates since the control logic has to be updated in many pages. The server.transfer() function does not throw an error when called from a page object. Thanks for any help!
Where are you calling the server.transfer function from? There is a common reason why this fails when you transfer to a page that validates view state, and fails to validate view state of the calling page. The solution for this problem is to turn off view state
validation for the target page. Thanks,
Mike Volodarsky
CTO at LeanSentry
Former IIS/ASP.NET PM
Want to become an expert at monitoring and troubleshooting your IIS applications?
See the demo at www.leansentry.com!
I wrote a custom HttpHandler that has the following code: 'Some processing logic 'to determine what page 'to load context.server.transfer("loadthispage.aspx") I put a breakpoint to see the step by step execution and everything is fine up until the server.transfer()
call. It always generates the exeception: Error executing child request for loadthispage.aspx I wrote in the @page directive of both pages the enableViewState="False", and I'm still getting the same error. I also tried turning off enableViewStateMac and enableSessionState.
The exception stack trace reads: [HttpException (0x80004005): Error executing child request for Webform2.aspx.] System.Web.HttpServerUtility.ExecuteInternal(String path, TextWriter writer, Boolean preserveForm) System.Web.HttpServerUtility.Transfer(String
path, Boolean preserveForm) System.Web.HttpServerUtility.Transfer(String path) TestApps.Handler.ProcessRequest(HttpContext context) in C:\Inetpub\wwwroot\TestApps\Handler.vb:29 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication +IExecutionStep.Execute()
+179 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 I really hope this helps. I've developed a workaround in the meantime, but it affects performance since every page request requires a double postback. Thanks
in advance, Victor
Inside that page, you can use the Page.enableViewStateMac property, or the enableViewStateMac attribute on the directive. But, in this case, be aware that http clients could modify your viewstate outside of your application and submit it back to you. If you
are only using viewstate to keep track of non-sensitive/UI information that can be submitted via forms anyway, its not a big deal. But, if you are using controls that keep sensitive information in viewstate, it may be a security problem. Hope this helps,
Mike Volodarsky
CTO at LeanSentry
Former IIS/ASP.NET PM
Want to become an expert at monitoring and troubleshooting your IIS applications?
See the demo at www.leansentry.com!
so just before Server.Transfer to Page2.aspx , set Page2.enableViewStateMac = False ... or in Page2.Init , set Page2.enableViewStateMac = False ... but when to set Page2.enableViewStateMac back to True .... in Page2.OnPreRender ?
vmchico
Member
10 Points
2 Posts
HttpHandler & Server.Transfer
Jan 20, 2004 07:50 PM|LINK
mvolo
Contributor
2202 Points
441 Posts
MVP
Re: HttpHandler & Server.Transfer
Jan 27, 2004 03:36 AM|LINK
CTO at LeanSentry
Former IIS/ASP.NET PM
Want to become an expert at monitoring and troubleshooting your IIS applications?
See the demo at www.leansentry.com!
vmchico
Member
10 Points
2 Posts
Re: HttpHandler & Server.Transfer
Jan 27, 2004 12:37 PM|LINK
johnagrandy
Participant
1670 Points
362 Posts
Re: HttpHandler & Server.Transfer
Oct 20, 2004 12:34 AM|LINK
mvolo
Contributor
2202 Points
441 Posts
MVP
Re: HttpHandler & Server.Transfer
Oct 20, 2004 05:59 AM|LINK
CTO at LeanSentry
Former IIS/ASP.NET PM
Want to become an expert at monitoring and troubleshooting your IIS applications?
See the demo at www.leansentry.com!
johnagrandy
Participant
1670 Points
362 Posts
Re: HttpHandler & Server.Transfer
Oct 20, 2004 06:09 AM|LINK
mvolo
Contributor
2202 Points
441 Posts
MVP
Re: HttpHandler & Server.Transfer
Oct 21, 2004 09:56 PM|LINK
CTO at LeanSentry
Former IIS/ASP.NET PM
Want to become an expert at monitoring and troubleshooting your IIS applications?
See the demo at www.leansentry.com!
johnagrandy
Participant
1670 Points
362 Posts
Re: HttpHandler & Server.Transfer
Nov 17, 2004 05:19 AM|LINK