use httphandler to dynamically output system.web.ui.page via Master Page

Discussion in 'ASP .Net' started by zootius, Dec 7, 2005.

  1. zootius

    zootius Guest

    Hi - I'm working on a front-controller style application in ASP.NET
    2.0. I have mapped all HTTP requests to ASPNET_ISAPI, and use an
    HttpModule to do a database lookup on the search-engine-friendly URLs
    that my app uses, in order to select the correct output for the
    context.

    Mapping the HTTP request to a physical ASPX page seems fairly
    straightforward with HttpContext.RewritePath. However, I don't really
    want any physical ASPX pages in my app. All my content lives in the
    database, so I'd rather create a System.Web.UI.Page object in the
    HttpHandler, set it to use a MasterPage for templating the output, and
    add WebControls and Content to it as required by the request URL
    context.

    Anyway, I created a class that extends System.Web.UI.Page and set this
    as my HttpHandler in web.config. Lo and behold, I can get it it to
    handle requests. HOWEVER - I can't get it to work with MasterPages when
    I try to set it via the Page.MasterPageFile property. The
    "MasterPage.CreateMaster()" fails in its call to
    "VirtualPathProvider.CombineVirtualPathsInternal()" because apparently
    basePath is null.

    Has anybody else solved this?
    zootius, Dec 7, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Doug McCann
    Replies:
    1
    Views:
    982
    William Brogden
    Aug 5, 2004
  2. Zeba
    Replies:
    1
    Views:
    471
    Mark Rae
    Feb 22, 2007
  3. Kenroy Bennett
    Replies:
    2
    Views:
    126
    Rodrick Brown
    Sep 11, 2013
  4. Jean-Michel Pichavant
    Replies:
    0
    Views:
    109
    Jean-Michel Pichavant
    Sep 13, 2013
  5. Chris Angelico
    Replies:
    0
    Views:
    110
    Chris Angelico
    Sep 13, 2013
Loading...

Share This Page