views:

461

answers:

1

OK, I have a standard ASP.NET WebForms Application (3.5, SP1)... I've just added the System.Web.Routing DLL, and set a route to a point to a new handler. That handler is VERY VERY simple, and simply returns a new instance of a standard page.

Code here:

public class ReportRouteHandler : IRouteHandler
{
    IHttpHandler IRouteHandler.GetHttpHandler(RequestContext requestContext)
    {
        return new ViewReport();
    }
}

The page is running, and I can put a breakpoint on OnInit, and OnLoad... heck, I can even put a Response.Write("hello!!!"); in the OnLoad event and it correctly sends to the client browser!

However, nothing else (none of the HTML in my ViewRoute.aspx page) is being sent across the wire. Now, if I just navigated to that ASPX page, then everything comes across.

What am I missing here? Why my page not Rendering to the browser?

By the way, the "Render" method is firing as well... and if I put a break point down there, I can type writer.Write("Hello!") in the immediate window, and it works... but the page itself isn't rendering (when navigated to via an ASP.NET Routing call).

A: 

To add to the confusion... when I debug a normal request to the page... "this.Controls.Count" == 1... but when I use a 'routed' request, "this.Controls.Count" == 0?

Hope this helps the search for the answer.

Timothy Khouri