473,386 Members | 1,943 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,386 software developers and data experts.

Data driven site strategy for normal URLs

Hi there,

I'm designing a site with pages where the layout is the same and
content is different. So, obviously, I'm just coding one page and
brining the data in from the database. The drawback to this is that
the URL names aren't really meaningful. For example, let's say I have
an aboutus page and a directions page. In a statically coded site, the
urls might be www.site.com/aboutus.aspx and
www.site.com/directions.aspx. In my case, since I'm using the same
page it would be more like www.site.com/template1.aspx?pageId=6 where
6 is the PK of the page in the database. Is there a way to have the
best of both worlds?

Once solution I've considered is customizing my 404 pages. So a user
could type www.site.com/aboutus.aspx. The 404 page would look up
about.aspx's pageId and server.transfer to
template1.aspx?pageId=[about's pageId]. This doesn't seem particularly
elegant to me.

I was considering making each of the pages and inheriting from a
custom page class, but then I'd still have to hard code the page Id in
each of the pages, which is somewhat messy - especially for adding new
pages dynamically.

Thoughts?
Nov 18 '05 #1
1 1020
Have you looked at HTTPHandlers and the RewritePath function? You can make
pretty much any URL execute pretty much any page on your site.

--
Thanks,

Eric Lawrence
Program Manager
Assistance and Worldwide Services

This posting is provided "AS IS" with no warranties, and confers no rights.

"nick" <ni**********@hotmail.com> wrote in message
news:30*************************@posting.google.co m...
Hi there,

I'm designing a site with pages where the layout is the same and
content is different. So, obviously, I'm just coding one page and
brining the data in from the database. The drawback to this is that
the URL names aren't really meaningful. For example, let's say I have
an aboutus page and a directions page. In a statically coded site, the
urls might be www.site.com/aboutus.aspx and
www.site.com/directions.aspx. In my case, since I'm using the same
page it would be more like www.site.com/template1.aspx?pageId=6 where
6 is the PK of the page in the database. Is there a way to have the
best of both worlds?

Once solution I've considered is customizing my 404 pages. So a user
could type www.site.com/aboutus.aspx. The 404 page would look up
about.aspx's pageId and server.transfer to
template1.aspx?pageId=[about's pageId]. This doesn't seem particularly
elegant to me.

I was considering making each of the pages and inheriting from a
custom page class, but then I'd still have to hard code the page Id in
each of the pages, which is somewhat messy - especially for adding new
pages dynamically.

Thoughts?

Nov 18 '05 #2

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

Similar topics

1
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering...
0
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the...
9
by: Tony Lee | last post by:
Some time a ago, on this newsgroup the following comments were made in recommending good references for Access (2003) >I used to recommend Dr. Rick Dobson's, "Programming Access <version>" for...
4
by: moondaddy | last post by:
I've made the decision to use search engine friendly URLs in my site which means translating stripping all parameters our of the URL and converting it to a hierarchical URL like this: Change:...
27
by: Josh | last post by:
We have a program written in VB6 (over 100,000 lines of code and 230 UI screens) that we want to get out of VB and into a better language. The program is over 10 years old and has already been...
8
by: Radx | last post by:
Here in my web application, I have a data entry page with serval controls. Some of the controls have autopostback is set true. But the problem is when two or more people are entering data at the...
8
by: Yoshitha | last post by:
Hi I want to Extracet(retrieve) data from some of websites and the retrieved data has to be saved in excel or.csv files. I need to develop this in ASP.net(using C#.net Vs 2003). Can any...
71
by: Murray R. Van Luyn | last post by:
Hi, Since I have made changes to my website it's been a complete flop. According to the logs, as soon as visitors have downloaded the index page they are off. I can't figure out why? ...
46
by: ahmed.maryam | last post by:
Hi all, I have 2 C# applications that I need to pass data between. Specifically XML information such as a document or node name. How can I do that? Thanks in advance! ~ Maryam
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.