views:

59

answers:

2

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. 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).

A: 

here is the flow for this process.
- use a http module. module gets
- request get requested page name and find xls file.
- populate xsl file data as xml.
- merge xml and xls.
- send response to client.

Ozan BAYRAM
Thanks for your answer. Can you be a bit more specific than 'use a http module'.
mdresser
A: 

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.aspx is requested, this is handled by www.mysite.com/ShowPage.aspx?PageName=about-us and inside ShowPage.aspx I have code as follows:

protected void Page_Load(object sender, EventArgs e)
{
    string xmlFile = "~/" + Request["PageName"] + ".xml";
    xmlContent.DocumentSource = xmlFile;
}
mdresser