Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have added some aspx pages in my Current mvc application on the server side code of aspx page i want to send some data in query string but i always got error message error in executing child request.as (there is no controller or action method in my page) My code is
C#
protected void gvShowDetail_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "EditDetail")
            {
                Server.Transfer("EditDetail?ID=" + Convert.ToString(e.CommandArgument) + "&mode=Edit");
            }
        }
Posted

<pre lang="c#">var httpContext = HttpContext.Current;
                if (HttpRuntime.UsingIntegratedPipeline)
                    Server.TransferRequest("EditDetail?ID=" + Convert.ToString(e.CommandArgument) + "&mode=Edit", true);
                else
                {
                    httpContext.RewritePath("EditDetail?ID=" + Convert.ToString(e.CommandArgument) + "&mode=Edit", true);

                    IHttpHandler httpHandler = new MvcHttpHandler();
                    httpHandler.ProcessRequest(httpContext);
                }

public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
{
return routeDirection == RouteDirection.IncomingRequest;
}
 
Share this answer
 
Same problem discussed in below link try the solution

error in executing child request[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900