By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,971 Members | 1,451 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,971 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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" <je******@gmail.com> a écrit dans le message de
news:26**************************@posting.google.c 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.

Nov 19 '05 #2

P: n/a
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" <je******@gmail.com> a écrit dans le message de
news:26**************************@posting.google.c 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.


Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.