Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to simulate a directory structure of aspx pages with one processing page

Reply
Thread Tools

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

 
 
Janusz Jezowicz
Guest
Posts: n/a
 
      04-27-2005
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.
 
Reply With Quote
 
 
 
 
Patrice
Guest
Posts: n/a
 
      04-27-2005
You could :

1) Try :
http://msdn.microsoft.com/library/de...lrewriting.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" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed) om...
> 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.



 
Reply With Quote
 
 
 
 
=?Utf-8?B?TWlrbGU=?=
Guest
Posts: n/a
 
      04-30-2005
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/de...ttpmodules.asp

"Patrice" wrote:

> You could :
>
> 1) Try :
> http://msdn.microsoft.com/library/de...lrewriting.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" <(E-Mail Removed)> a écrit dans le message de
> news:(E-Mail Removed) om...
> > 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.

>
>
>

 
Reply With Quote
 
Jennifer Mathews
Guest
Posts: n/a
 
      11-15-2009
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.


"uyt" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> fgsd
>
> From
> http://www.google.co.in/search?hl=en...meta=&aq=f&oq=
>
> Posted via DevelopmentNow.com Groups
> http://www.developmentnow.com/g/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulate webform inheritance without using master pages Pedro Mir ASP .Net 0 08-16-2006 11:24 AM
passing variables from .aspx.cs code pages to .aspx pages RadioSignal ASP .Net Web Controls 7 10-21-2005 11:41 PM
simulate virtual directory - I need it urgently Amir Eshterayeh ASP .Net 1 02-05-2004 01:11 PM
simulate virtual directory for each user Scott M. ASP .Net 3 02-03-2004 07:26 PM
Delay in processing of aspx pages? Kristoffer Arfvidson ASP .Net 6 01-24-2004 12:02 AM



Advertisments