I want to develop a web application with a master page containing an <asp:Xml /> control for rendering xhtml content stored in xml files.
I can do this easily enough by creating a WebContent aspx page per xml file, but what I want to know is how to go about developing a single request handler which will detect a request for a page e.g. http://www.mysite.com/HomePage.aspx then generate a page based on the master page and assume that a corresponding xml content file exists (e.g. HomePage.xml).
I’ve decided to tackle this in a different way…
I’m using UrlRewritingNet to handle requests for pages and have a single page (ShowPage.aspx) which loads the appropriate xml content file depending on a url parameter.
So if the page
www.mysite.com/about-us.aspxis requested, this is handled bywww.mysite.com/ShowPage.aspx?PageName=about-usand insideShowPage.aspxI have code as follows: