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

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

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

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. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    1,261
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. Kristoffer Arfvidson

    Delay in processing of aspx pages?

    Kristoffer Arfvidson, Jan 22, 2004, in forum: ASP .Net
    Replies:
    6
    Views:
    688
    Kristoffer Arfvidson
    Jan 24, 2004
  3. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,594
    Matt Morris
    Jan 23, 2004
  4. roger janssens via DotNetMonster.com

    including several pages in one aspx page

    roger janssens via DotNetMonster.com, Feb 25, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    824
    =?Utf-8?B?VGlt?=
    Feb 25, 2005
  5. =?Utf-8?B?Uk1M?=
    Replies:
    1
    Views:
    721
    =?Utf-8?B?QW5keSBMdWtzaWM=?=
    Sep 16, 2005
  6. Progman
    Replies:
    2
    Views:
    2,147
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 13, 2006
  7. uto
    Replies:
    3
    Views:
    822
    Michael Hamrah
    Mar 8, 2006
  8. RadioSignal

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

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