473,385 Members | 2,015 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,385 software developers and data experts.

Eliminate .aspx File (100% dynamic page)

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.
Oct 9 '07 #1
6 1767
On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrote:
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

Oct 9 '07 #2
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.

Oct 9 '07 #3

"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@y42g2000hsy.googlegro ups.com...
On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrote:
>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.*

Oct 9 '07 #4
On Oct 9, 7:50 pm, "Frankie" <A...@B.comwrote:
"Alexey Smirnov" <alexey.smir...@gmail.comwrote in message

news:11*********************@y42g2000hsy.googlegro ups.com...


On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrote:
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

Oct 9 '07 #5
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.
Oct 9 '07 #6
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]
<pbromb...@yahoo.yohohhoandabottleofrum.comwrote :
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.

Oct 12 '07 #7

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

Similar topics

7
by: Bruce W...1 | last post by:
I made my first PHP page that uses includes. http://php.didah.com/main.php But I can't get rid of a gap (about 5 pixels) between the table rows. The content of each include file is one line like...
5
by: Jeff | last post by:
Greetings I am beginning a web app. I am using C# aspx forms for my web pages. Is it possible to create/use one aspx file as a base from which to derive other aspx files? I can not get this to...
3
by: Stevie_mac | last post by:
It might be me but... I dont seem to get a Page_Load event when a opening an ASPX in an iFrame. I do geta Page_Load event when an item on the ASPX (inside the iFrame) is clicked but then...
0
by: JJ | last post by:
I am trying to use .ashx files to handle dynamic image requests. The aspx page needs to pass the data to the ashx file. It was decided to not use the query string. Instead we hoped we could use the...
2
by: Richard Lionheart | last post by:
Hi All, I adapted some sample code from w3schools.com and tried to adapt it to .NET to test dynamic processing in a WebForm. The client page that got generated produced everything that was...
10
by: ptass | last post by:
Hi In asp.net 2.0 an aspx files .cs file is a partial class and all works fine, however, I thought I’d be able to create another class file, call it a partial class and have that compile and...
5
by: Rich S | last post by:
I created this neat little .net site which tracks the inventory of my little widge company giving me real time inventory counts and whatnot. It uses your standard code that calls a stored procedure...
1
by: vj | last post by:
How i can populate all fileds dynamically in jsp page based on contents found in xml file? I have written jsp servlets and java class file. i transferred automatic data from jsp to servlet then to...
38
by: Neo Geshel | last post by:
I am seeking a method to load one JS file directly into another, *without* having to dynamically write <scripttags. Is there any method whereby I can call only one external JS file using a ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.