How to simulate a directory structure of aspx pages with one processing page

  • Thread starter Thread starter Janusz Jezowicz
  • Start date Start date
J

Janusz Jezowicz

Hello!

I would like to have one page on the server, which would be a target
processing page for a number of other aspx pages.

E.g
Processing page
\portal_page.aspx

Target pages
\business\credit_cards\barclaycard.aspx
\business\loans\halifax.aspx
\business\savings_accounts\halifax.aspx


When somebody makes a request to the
\business\credit_cards\barclaycard.aspx then the page would execute a
code from the portal_page.aspx

I know that this behaviour could be easily done by creating all this
target pages and directories and include a portal_page.aspx inside
these pages.

However, in my case the directory will contain thousands of pages and
often new pages will be added or current removed. It would be hard to
maintain such a large directory.

Is it possible to receive a request for
\business\credit_cards\barclaycard.aspx even though the page is not
there? And present to the user the contents of portal_page.aspx but
with a \business\credit_cards\barclaycard.aspx in the address bar.

I know it could be done by capturing HTTPException - file not found in
global.asax. And based on the requested filename, then execute the
portal_page.aspx with appropriate parameters. However, the user would
see a portal_page.aspx in the address bar , rather than
\business\credit_cards\barclaycard.aspx.

Does anyone has any idea how to solve this problem?

Thank you.
 
Create a class ( i.e. myClass.dll ) and call that class from each each of your pages:

\business\credit_cards\barclaycard.aspx
\business\loans\halifax.aspx
\business\savings_accounts\halifax.aspx

using a placeholder object in your aspx pages.
 
Back
Top