I am building a website with ASP.NET 3.5 and most of the site structure is static enough to create aspx folder and page structure. However, site administrators want to add new pages to different sections of the site through the web interface and use the WYSIWYG editor. I use nested master pages to give different sections of the site my own menus. What I would like to do is create a shared page under each section of the site that uses the corresponding main page, and has room for content that can be downloaded from the database. I would also like these “fake” pages to have a URL, for example, any other aspx page, as if they had the corresponding files on the server. So instead of my url:
http:
it will be something like:
http:
The problem is that somethingmeaningful.aspx does not exist, because the administrator created it through the web interface, and the contents are stored in the database. I think I am implementing an HTTP handler that handles requests for aspx files. In this handler, I will check if the requested URL is an actual file or one of my "fake pages". If this is a request for a fake page, I redirect the request to the general content page for the corresponding section, change the request line to request the corresponding data from the database and rewrite the URL so that it looks like the user has a fake page. The problem I'm currently facing is that I cannot figure out how to redirect the request to the default handler for aspx pages.I tried to create an instance of PageHandlerFactory, but constuctor is protected internally. Is there any way for me to tell my HttpHandler about a call to HttpHandler that will normally be used to process the request? Currently, my handler code is as follows:
using System.Web;
using System.Web.UI;
namespace HandlerTest
{
public class FakePageHandler : IHttpHandler
{
public bool IsReusable
{
get { return false; }
}
public void ProcessRequest(HttpContext context)
{
if(RequestIsForFakedPage(context))
{
PageHandlerFactory factory = new PageHandlerFactory();
factory.GetHandler(context, context.Request.RequestType, GetGenericContentPath(context), GetPhysicalApplicationPath(context)).ProcessRequest(context);
}
else
{
PageHandlerFactory factory = new PageHandlerFactory();
factory.GetHandler(context, context.Request.RequestType, context.Request.Path, context.Request.PhysicalPath).ProcessRequest(context);
}
}
public string RequestForPageIsFaked(HttpContext context)
{
}
public string GetGenericContentPath(HttpContext context)
{
}
public string GetPhysicalApplicationPath(HttpContext context)
{
}
}
}
, , , - URL-, - ? PageHandlerFactory, ? "" HttpHandler aspx? : " ASPX, ."