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

Discussion in 'ASP .Net' started by Janusz Jezowicz, Apr 27, 2005.

  1. 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.
     
    Janusz Jezowicz, Apr 27, 2005
    #1
    1. Advertising

  2. Janusz Jezowicz

    Patrice Guest

    You could :

    1) Try :
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp

    2) The mention of "including" the portal_page.aspx make me think this is
    perhaps not exactly what you want. It looks like you are more looking at a
    way to have centralized code. With ASP.NET you can add classes to your
    project and use their functionality from any page in your site...

    Hope it helps

    Patrice

    --

    "Janusz Jezowicz" <> a écrit dans le message de
    news:...
    > 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.
     
    Patrice, Apr 27, 2005
    #2
    1. Advertising

  3. Re: How to simulate a directory structure of aspx pages with one p

    I think an HTTPModule is the easiest way to do this. Using an HTTPModule you
    could say something like this (pseudocode):
    If (Request is in folder "barclaycard") Then
    Sever.Execute("portal_page.aspx")
    Response.End()
    End If

    Take a look at this very easy guideline on how to build an HTTPModule:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconhttpmodules.asp

    "Patrice" wrote:

    > You could :
    >
    > 1) Try :
    > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/urlrewriting.asp
    >
    > 2) The mention of "including" the portal_page.aspx make me think this is
    > perhaps not exactly what you want. It looks like you are more looking at a
    > way to have centralized code. With ASP.NET you can add classes to your
    > project and use their functionality from any page in your site...
    >
    > Hope it helps
    >
    > Patrice
    >
    > --
    >
    > "Janusz Jezowicz" <> a écrit dans le message de
    > news:...
    > > 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.

    >
    >
    >
     
    =?Utf-8?B?TWlrbGU=?=, Apr 30, 2005
    #3
  4. Jennifer Mathews, Nov 15, 2009
    #4
    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. Amir Eshterayeh

    simulate virtual directory - I need it urgently

    Amir Eshterayeh, Feb 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    511
    caviar
    Feb 5, 2004
  2. Kristoffer Arfvidson

    Delay in processing of aspx pages?

    Kristoffer Arfvidson, Jan 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    527
    Kristoffer Arfvidson
    Jan 24, 2004
  3. Scott M.
    Replies:
    3
    Views:
    457
    Amir Eshterayeh
    Feb 3, 2004
  4. Pedro Mir
    Replies:
    0
    Views:
    352
    Pedro Mir
    Aug 16, 2006
  5. RadioSignal

    passing variables from .aspx.cs code pages to .aspx pages

    RadioSignal, Sep 12, 2005, in forum: ASP .Net Web Controls
    Replies:
    7
    Views:
    2,247
    Mirronelli
    Oct 22, 2005
Loading...

Share This Page