Click here to Skip to main content
13,763,803 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi all,

i got problem when access to the home page. at first i use "server.transfer" but then still no works.

here the code:


Session["username"] = username.Text;

            if (roles == "administrator,user")
            {
                Server.Transfer("~/Admin/Home.aspx");
            }
            else if (roles == "manager,user")
            {
                Server.Transfer("~/Manager/Home.aspx");
            }
            else if (roles == "user")
            {
                Server.Transfer("~/User/Home.aspx");
            }
when i access to manager and admin home page it works.but when i want to access to user homepage; the error appear: Error executing child request for /OMC1/User/Home.aspx.

pls guys help me.i have to submit the project asap

thanks a lot
musiw.
Posted 31-May-12 23:04pm
musiw102
Updated 31-May-12 23:05pm
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Use Response.Redirect. Documented issue by MS, here:
PRB: "Error Executing Child Request" Error Message When You Use Server.Transfer or Server.Execute in ASP.NET Page[^]

Alternatively, similar issue resolved here: Server.Transfer throws Error executing child request. How to resolve?[^]
Use: HttpContext.Current.RewritePath("somefile.aspx");
  Permalink  
Comments
musiw 2-Jun-12 0:26am
   
i already try your solution, rewritepath("page.aspx"); but after i login the login page appear 2 times.i have to login again
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

The another way to resolve this error is to add an Handler in webconfig file:
http://www.banmanpro.com/support2/Error_executing_child_request.asp[^]
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.181113.4 | Last Updated 28 May 2014
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100