You are here: Re: Create page 'on the fly' & Use of Period / Stop / . in url « HTML « IT news, forums, messages
Re: Create page 'on the fly' & Use of Period / Stop / . in url

Posted by Harlan Messinger on 12/31/06 14:03

iam247@gmail.com wrote:
> Hi
>
> I want to create a dynamic web page which is only created when the
> users browser requests it. eg
>
> www.mydomain.com/jim.wilson.aspx
> or www.mydomain.com/bill.smith.htm
>
> 2 questions:
>
> 1.
> I know that the use of Period / Stop / . is primarily to separate the
> page neme from the page type eg mypage.htm or mypage.asp and that the .
> is not normally used within a page name.
>
> The use of the Period / Stop / . works ok when I create a page in
> Frontpage eg test.page.htm but I have not tested it on a live server.
>
> Will the . work as described above?

The part after the period is called the "extension". I'm not sure what
you mean by "working", but IIS will by default serve files with any of
the extensions .htm, .html, .asp, .aspx as text/html. You can use ASP or
ASP.NET (or any server-side app) to produce response of other types, but
then you have put

Response.ContentType = "[media type]"

in ASP, or the ASP.NET equivalent, into your code, at the top, before
the code has generated any content.

But if the page you've created has ASP.NET code in it, and the extension
is .htm or .html, the code isn't going to be executed either locally or
on a server. You *can* configure IIS to treat .htm or .html files as
ASP.NET pages, but why would you do that instead of just giving them an
..aspx extension?

> 2.
> Using ASP.net is it practical to create my requirements where the page
> is generated 'on the fly' ie Jim.Wilson's page is only generated when
> someone requests that specific url?

I don't understand your question. The server doesn't send any page until
someone requests it. Further, any page that contains server-side code is
by definition being generated on the fly.

>
> I know that some sites I visit with an invalid url return a default
> message with an index page (rather than a '404'), so I am assuming that
> good asp programming could also dynamically generate jim.wilson.aspx

I really don't understand the connection here. You can configure IIS to
send a custom page in place of any of the default pages that it sends
for any of the error conditions from 401 on up, including 404. How IIS
is set up to respond to 404 errors has nothing to do with the way you've
built or named your pages.

Because of this last part, I'm starting to think that you haven't asked
your real question--that this is a case where you've got a problem,
you're assuming that the solution takes a particular form, and then you
have questions about how to make that solution happens, which isn't
going to help you if that isn't the right solution in the first place.
What are you really trying to do? If the underlying question is, "How do
I change the way my server responds to a 404 error?", and you've noticed
that IIS seems to require a file whose name ends in .htm and doesn't
work if you provide a file name that ends in .aspx, the answer is that
you are also given a choice between "File" and "URL", and you have to
change it from "File" to "URL" if you want the response to come from an
ASP.NET page instead of a static HTML file.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация