473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

catching all requests with a single page

I have this idea, I need to know if it is possible and how.

Let's say you have a content managed site with all its structure and content - everything in a relational database

And a "blank" page that loads content from the database. This one single page would have to know what content is requested. Obviously this could be done by pageIDs in querystring and whatnot but this is not what I'd like

Here's what I need

The "blank" page lies in root of the web application and is named Default.aspx. I want every request to the website to be "transferred" to this page. So if someone types http://mysite.com/sales/books I want the "blank" page to be loaded instead of trying to load /sales/books/Default... which doesn't exist. The blank page should read the request URL and separate 'sales' and 'books' from the rest of the URL and using those values load the right content from the database.

If there is no content in the database stored under sales/books the blank page would try to Server.Transfer to a real page that was actually requested '/sales/books'. This isn't really that neccessary for what I have in mind but I'd like to keep the option to load other real existing pages just in case

Can someone point me in the right direction? How to force IIS or the httpapplication to always load the same page no matter what the request URL is

Nov 18 '05 #1
4 1751
Very bad idea. You're putting the weight of the entire application on a
single page. While you could certainly create an HttpHandler that would do
this, it would be a waste of time.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Adrijan Josic" <ad*****@vipdata.hr.remove_this> wrote in message
news:A9**********************************@microsof t.com...
I have this idea, I need to know if it is possible and how..

Let's say you have a content managed site with all its structure and content - everything in a relational database.
And a "blank" page that loads content from the database. This one single page would have to know what content is requested. Obviously this could be
done by pageIDs in querystring and whatnot but this is not what I'd like.
Here's what I need:

The "blank" page lies in root of the web application and is named Default.aspx. I want every request to the website to be "transferred" to
this page. So if someone types http://mysite.com/sales/books I want the
"blank" page to be loaded instead of trying to load /sales/books/Default...
which doesn't exist. The blank page should read the request URL and separate
'sales' and 'books' from the rest of the URL and using those values load the
right content from the database.
If there is no content in the database stored under sales/books the blank page would try to Server.Transfer to a real page that was actually requested
'/sales/books'. This isn't really that neccessary for what I have in mind
but I'd like to keep the option to load other real existing pages just in
case.
Can someone point me in the right direction? How to force IIS or the httpapplication to always load the same page no matter what the request URL
is?

Nov 18 '05 #2
The only thing this single page would do is fetch the content from the database and do
this.Controls.Add(this.ParseControl(contentFromDat abase))...
That's basicly all the code the page would have... I don't see how I could split this 'weight' in any way...

since I'm loading controls with ParseControl I can have custom user controls within the content stored in the database that actually have to do some server side work...

So there's not much weight on that single page. All it does is ParseControl(). Menu building and other eventual server side work is done by custom user controls that are embedded within the content stored in the database...

Nov 18 '05 #3
Response.Redirect will cause a roundtrip to the client and the address in the clients window will change to what I redirected which i don't want..

also, the CMS doesn't know if the site uses the session... it doesn't have to use a session in other words...
Nov 18 '05 #4
this is actually pretty easy with .net. You write an application module that
remaps the url path. so http://mysite.com/sales/books would be remapped to
mypage.aspx?l1=sales&l2=books.

see: HttpContent.RewritePath

-- bruce (sqlwork.com)

"Adrijan Josic" <ad*****@vipdata.hr.remove_this> wrote in message
news:A9**********************************@microsof t.com...
I have this idea, I need to know if it is possible and how..

Let's say you have a content managed site with all its structure and content - everything in a relational database.
And a "blank" page that loads content from the database. This one single page would have to know what content is requested. Obviously this could be
done by pageIDs in querystring and whatnot but this is not what I'd like.
Here's what I need:

The "blank" page lies in root of the web application and is named Default.aspx. I want every request to the website to be "transferred" to
this page. So if someone types http://mysite.com/sales/books I want the
"blank" page to be loaded instead of trying to load /sales/books/Default...
which doesn't exist. The blank page should read the request URL and separate
'sales' and 'books' from the rest of the URL and using those values load the
right content from the database.
If there is no content in the database stored under sales/books the blank page would try to Server.Transfer to a real page that was actually requested
'/sales/books'. This isn't really that neccessary for what I have in mind
but I'd like to keep the option to load other real existing pages just in
case.
Can someone point me in the right direction? How to force IIS or the httpapplication to always load the same page no matter what the request URL
is?

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
6
by: Karl A. Krueger | last post by:
I'm in the middle of refactoring a small mod_python Web application, which uses the Publisher handler. This application is currently a single main Python file (which loads several other files as...
11
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
1
by: slugger | last post by:
Hope this is not OT: I am running into some strange things whenever my ASP pages send out simultaneous requests to another ASP page which in turn gains access to a MySQL database using a DSNless...
4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
2
by: Chad McCune | last post by:
I'm developing a portal for our intranet where multiple pages are being shown inside several iframes on a single page. The problem i've ran into, is that it seems as if IIS6/ASP.Net serializes...
2
by: michaelpyles | last post by:
I have an ASP page the has session state disabled. This page creates an instance of a COM component written in C++ (threading model is BOTH, using ATL-FREE_THREADED macro in stdafx.h, supports free...
2
by: bizt | last post by:
Hi, I have a page that makes many XmlHttpRequest requests from a single page. This works fine but I need some requests to be made over a secure connection. To my understanding, when setting the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.