473,770 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.as px" with no such .aspx file having ever existed on disk
on the Web server.

Thanks.
Oct 9 '07 #1
6 1781
On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrot e:
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.as px" 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.as px" 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******** *************@y 42g2000hsy.goog legroups.com...
On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrot e:
>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.as px" 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.comwrot e:
"Alexey Smirnov" <alexey.smir... @gmail.comwrote in message

news:11******** *************@y 42g2000hsy.goog legroups.com...


On Oct 9, 7:07 pm, "Frankie" <A...@B.comwrot e:
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.as px" 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.as px" 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("cl ientkey");
int numstrings = myProverbs.Leng th;
int myRandIndex = r.Next(numstrin gs);
String answer = myProverbs[myRandIndex];

context.Respons e.ContentType = "text/xml";
context.Respons e.AddHeader("Ca che-Control", "no-cache");

context.Respons e.Write("<?xml version=\"1.0\" ?>");
context.Respons e.Write("<stuff >");
context.Respons e.Write("<quote >" + answer + "</quote>");
context.Respons e.Write("<clien tkey>" + myParam + "</
clientkey>");
context.Respons e.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...@yaho o.yohohhoandabo ttleofrum.comwr ote:
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.as px" 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
16000
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 this: <img src="images/nav.gif" width="100" height="600" hspace="0" vspace="0" border="0"> No head or body tags. Just a 100 x 600 gif image. Here's the code for the main.php page:
5
2722
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 work. What I tried was this: Create a new web project. - rename WebForm1.aspx to MyBase.aspx - Add (grad from tool box) a label to the html form - Then create another aspx file (using "Add Web Form"). This produces WebForm2.aspx.
3
4019
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 IsPostBack=False by now!. The ASPX is opened via client side script (into an iFrame) inside a .HTM file (as ASPX postback causes problems in a modal internet explorer dialog if not in an iFrame!) Anyone know how to get around this - i need to...
0
2711
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 Session or the Context cache. e.g. (in the aspx page) Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Me.Context.Current.Items.Add("Msg", "NAM2") Me.Session.Add("Msg", "NAM2")...
2
1792
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 coded except for displaying the time at which it was generated. I tried everything I could think of to rewrite this and to debug this. Anyone out there in Cyberspace got any idea why the time doesn't get displayed. The .aspx code follows below
10
2445
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 load as a 3rd partial class. This would be handy so i can generate standard code into one of the partial classes, while having my custom code untouched
5
2060
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 and loads up a datagrid and works really well. It occurred to me that since my database inventory is only updated once per day at 6:30 am having this dynamic query and page generation is overkill and I really just need to save the output to...
1
6528
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 java class which creates a xml file based on values entered in dynamic jsp page. Now i want to read all those values entered to xml in my other jsp page. I am able to call values from file in my jsp page. But as dynamic values can be any in no...
38
4033
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 single <scripttag, but have that external JS file insert into ITSELF the contents of five others? Something like: /*start external.js*/
0
9617
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10257
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10099
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.