Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Eliminate .aspx File (100% dynamic page)

Reply
Thread Tools

Eliminate .aspx File (100% dynamic page)

 
 
Frankie
Guest
Posts: n/a
 
      10-09-2007
What would it take to send a page to a browser - and the HTML that comprises
that "page" is 100% generated dynamically?

Specifically, say I have all of the requisite HTML in a string variable. How
do I push that string down to the browser?

My situation is that I have a few .aspx pages containing very little
boilerplate HTML markup and several placeholder controls. At runtime I am
currently injecting the requisite HTML into the placeholder controls. I am
wondering what it would take to eliminate the .aspx file altogether... such
that when the browser requests, for example,
www.DomainName\SomeFolder\File001.aspx I have logic that returns 100% of the
HTML of "File001.aspx" with no such .aspx file having ever existed on disk
on the Web server.



Thanks.


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      10-09-2007
On Oct 9, 7:07 pm, "Frankie" <(E-Mail Removed)> wrote:
> What would it take to send a page to a browser - and the HTML that comprises
> that "page" is 100% generated dynamically?
>
> Specifically, say I have all of the requisite HTML in a string variable. How
> do I push that string down to the browser?
>
> My situation is that I have a few .aspx pages containing very little
> boilerplate HTML markup and several placeholder controls. At runtime I am
> currently injecting the requisite HTML into the placeholder controls. I am
> wondering what it would take to eliminate the .aspx file altogether... such
> that when the browser requests, for example,www.DomainName\SomeFolder\File001.aspx I have logic that returns 100% of the
> HTML of "File001.aspx" with no such .aspx file having ever existed on disk
> on the Web server.
>
> Thanks.


Do you know about URL Rewriting?
http://www.google.com/search?hl=en&q...+url+rewriting

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      10-09-2007
use an httpmodule instead of a page.

-- bruce (sqlwork.com)

Frankie wrote:
> What would it take to send a page to a browser - and the HTML that comprises
> that "page" is 100% generated dynamically?
>
> Specifically, say I have all of the requisite HTML in a string variable. How
> do I push that string down to the browser?
>
> My situation is that I have a few .aspx pages containing very little
> boilerplate HTML markup and several placeholder controls. At runtime I am
> currently injecting the requisite HTML into the placeholder controls. I am
> wondering what it would take to eliminate the .aspx file altogether... such
> that when the browser requests, for example,
> www.DomainName\SomeFolder\File001.aspx I have logic that returns 100% of the
> HTML of "File001.aspx" with no such .aspx file having ever existed on disk
> on the Web server.
>
>
>
> Thanks.
>
>

 
Reply With Quote
 
Frankie
Guest
Posts: n/a
 
      10-09-2007

"Alexey Smirnov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> On Oct 9, 7:07 pm, "Frankie" <(E-Mail Removed)> wrote:
>> What would it take to send a page to a browser - and the HTML that
>> comprises
>> that "page" is 100% generated dynamically?
>>
>> Specifically, say I have all of the requisite HTML in a string variable.
>> How
>> do I push that string down to the browser?
>>
>> My situation is that I have a few .aspx pages containing very little
>> boilerplate HTML markup and several placeholder controls. At runtime I am
>> currently injecting the requisite HTML into the placeholder controls. I
>> am
>> wondering what it would take to eliminate the .aspx file altogether...
>> such
>> that when the browser requests, for
>> example,www.DomainName\SomeFolder\File001.aspx I have logic that returns
>> 100% of the
>> HTML of "File001.aspx" with no such .aspx file having ever existed on
>> disk
>> on the Web server.
>>
>> Thanks.

>
> Do you know about URL Rewriting?
> http://www.google.com/search?hl=en&q...+url+rewriting



Yes - but URL Rewriting has nothing to do with *how* a page is sent to the
browser. It has to do with how pages are *identified.*



 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      10-09-2007
On Oct 9, 7:50 pm, "Frankie" <(E-Mail Removed)> wrote:
> "Alexey Smirnov" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed) ups.com...
>
>
>
>
>
> > On Oct 9, 7:07 pm, "Frankie" <(E-Mail Removed)> wrote:
> >> What would it take to send a page to a browser - and the HTML that
> >> comprises
> >> that "page" is 100% generated dynamically?

>
> >> Specifically, say I have all of the requisite HTML in a string variable.
> >> How
> >> do I push that string down to the browser?

>
> >> My situation is that I have a few .aspx pages containing very little
> >> boilerplate HTML markup and several placeholder controls. At runtime I am
> >> currently injecting the requisite HTML into the placeholder controls. I
> >> am
> >> wondering what it would take to eliminate the .aspx file altogether...
> >> such
> >> that when the browser requests, for
> >> example,www.DomainName\SomeFolder\File001.aspx I have logic that returns
> >> 100% of the
> >> HTML of "File001.aspx" with no such .aspx file having ever existed on
> >> disk
> >> on the Web server.

>
> >> Thanks.

>
> > Do you know about URL Rewriting?
> >http://www.google.com/search?hl=en&q...+url+rewriting

>
> Yes - but URL Rewriting has nothing to do with *how* a page is sent to the
> browser. It has to do with how pages are *identified.*- Hide quoted text -
>


ASP.NET has to do it. Either something like Response.Write() or a
custom HttpModule, as Bruce already suggested

 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      10-09-2007
You have to have an Http - addressable endpoint. It could be an ASPX page, or
it could be an ASHX handler, etc. For a page, the only requirement is to have
the
<@Page declaration and specify the codebehind / codefile attribute. What you
do in your code is completely up to you.
-- Peter
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com



"Frankie" wrote:

> What would it take to send a page to a browser - and the HTML that comprises
> that "page" is 100% generated dynamically?
>
> Specifically, say I have all of the requisite HTML in a string variable. How
> do I push that string down to the browser?
>
> My situation is that I have a few .aspx pages containing very little
> boilerplate HTML markup and several placeholder controls. At runtime I am
> currently injecting the requisite HTML into the placeholder controls. I am
> wondering what it would take to eliminate the .aspx file altogether... such
> that when the browser requests, for example,
> www.DomainName\SomeFolder\File001.aspx I have logic that returns 100% of the
> HTML of "File001.aspx" with no such .aspx file having ever existed on disk
> on the Web server.
>
>
>
> Thanks.
>
>
>

 
Reply With Quote
 
harborsparrow
Guest
Posts: n/a
 
      10-12-2007
Add a file of type "generic handler". You can send back any kind of
content you want by providing the correct HTTP header information via
Response.Write statements. Code should look something like this:


<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;

public class Handler : IHttpHandler {

Random r = new Random();

public void ProcessRequest (HttpContext context) {

String myParam = context.Request.Params.Get("clientkey");
int numstrings = myProverbs.Length;
int myRandIndex = r.Next(numstrings);
String answer = myProverbs[myRandIndex];

context.Response.ContentType = "text/xml";
context.Response.AddHeader("Cache-Control", "no-cache");

context.Response.Write("<?xml version=\"1.0\"?>");
context.Response.Write("<stuff>");
context.Response.Write("<quote>" + answer + "</quote>");
context.Response.Write("<clientkey>" + myParam + "</
clientkey>");
context.Response.Write("</stuff>");
}

public bool IsReusable {
get {
return false;
}
}

String[] myProverbs = {
/* 0 */ "I am prepared for the worst, but hope for the best.
(Benjamin Disraeli)",
/* 1 */ "Lost time is never found again. (Ben Franklin)",
/* 2 */ "History is a pack of lies about events that never happened
told by people who weren't there. (George Santayana)",
/* 3 */ "Tact is the ability to describe others as they see
themselves. (Abe Lincoln)",
/* 4 */ "Always remember, a cat looks down on man, a dog looks up to
man, but a pig will look man right in the eye and see his equal.
(Winston Churchill)",
/* 5 */ "What's left at the bottom of the bag when it reaches you.
(Definition of microchips)",
};

}

On Oct 9, 4:31 pm, Peter Bromberg [C# MVP]
<(E-Mail Removed)> wrote:
> You have to have an Http - addressable endpoint. It could be an ASPX page, or
> it could be an ASHX handler, etc. For a page, the only requirement is to have
> the
> <@Page declaration and specify the codebehind / codefile attribute. What you
> do in your code is completely up to you.
> -- Peter
> Recursion: see Recursion
> site: http://www.eggheadcafe.com
> unBlog: http://petesbloggerama.blogspot.com
> BlogMetaFinder: http://www.blogmetafinder.com
>
> "Frankie" wrote:
> > What would it take to send a page to a browser - and the HTML that comprises
> > that "page" is 100% generated dynamically?

>
> > Specifically, say I have all of the requisite HTML in a string variable. How
> > do I push that string down to the browser?

>
> > My situation is that I have a few .aspx pages containing very little
> > boilerplate HTML markup and several placeholder controls. At runtime I am
> > currently injecting the requisite HTML into the placeholder controls. I am
> > wondering what it would take to eliminate the .aspx file altogether... such
> > that when the browser requests, for example,
> >www.DomainName\SomeFolder\File001.aspx I have logic that returns 100% of the
> > HTML of "File001.aspx" with no such .aspx file having ever existed on disk
> > on the Web server.

>
> > Thanks.



 
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
How to eliminate quotes around string field written to a file. len Python 4 05-15-2009 07:54 PM
What is the best way to edit a file to eliminate a line using Ruby? Steve [RubyTalk] Ruby 16 12-02-2005 04:07 PM
How can a eliminate this file??? MB_ Computer Support 4 01-05-2005 03:59 PM
How can I eliminate "Glitch"? Jluis VHDL 5 05-12-2004 07:59 PM
eliminate hard-coded file names in xsl Luke Airig XML 1 12-24-2003 11:11 AM



Advertisments