473,659 Members | 2,872 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get access to the complete HTML just before its sent to the client

Hi

In our web page we use a combination of HTML and server side controls and
some of them have a custom attribute based on which we need to find and
replace the values once the HTML is ready.

For e.g. <LABEL DICTCODE="XYZ"> Some text</LABEL>

At run time just before the complete HTML is sent to the client-side I want
to get hold of the HTML so that I can find and replace all the HTML elements
with DICTCODE attribute with some custom value.

Please advice.
Thanks
Rahul
Nov 18 '05 #1
3 1744
this is what httpmodules are for.
"Rahul Agarwal" <ag***********@ hotmail.com> wrote in message
news:ur******** ******@TK2MSFTN GP12.phx.gbl...
Hi

In our web page we use a combination of HTML and server side controls and
some of them have a custom attribute based on which we need to find and
replace the values once the HTML is ready.

For e.g. <LABEL DICTCODE="XYZ"> Some text</LABEL>

At run time just before the complete HTML is sent to the client-side I want to get hold of the HTML so that I can find and replace all the HTML elements with DICTCODE attribute with some custom value.

Please advice.
Thanks
Rahul

Nov 18 '05 #2
Hi Jim and Bruce

Thanks for you reply, it was a good e.g. to understand how we can get access
to the HTML just before rendering out. Can I take this a step further and
ask if it is possible that since I have access to the HTML I can add my
translation before rendering out but can I save the new HTML (with
translation) in to a Cache and for the next request just use the cache and
avoid the full page construction (rendering of each controls, etc) as I have
already got the HTML from the last request.

Is it possible and is it a good idea. The reason I am asking this that in
many of our pages we hardly use server side controls its mainly HTML
elements and we need to do some translation just before is rendered but to
improve performance can I generate the HTML once and reuse it again and
again.

Thanks a lot
Rahul Agarwal
"Jim Cheshire [MSFT]" <ja******@onlin e.microsoft.com > wrote in message
news:p1******** ******@cpmsftng xa06.phx.gbl...
Hi Rahul,

You can do that using a Stream object. I have a simple sample that does
it. I've attached it.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
ja******@online .microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
From: "Rahul Agarwal" <ag***********@ hotmail.com>
Subject: How to get access to the complete HTML just before its sent to

the client
Date: Thu, 5 Aug 2004 10:32:01 +1000
Lines: 17
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ur************ **@TK2MSFTNGP12 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 203.11.225.5
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2522 43X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi

In our web page we use a combination of HTML and server side controls and
some of them have a custom attribute based on which we need to find and
replace the values once the HTML is ready.

For e.g. <LABEL DICTCODE="XYZ"> Some text</LABEL>

At run time just before the complete HTML is sent to the client-side I wantto get hold of the HTML so that I can find and replace all the HTML

elements
with DICTCODE attribute with some custom value.

Please advice.
Thanks
Rahul

Nov 18 '05 #3
Rahul,

You can do that by overriding the Render method in your own base class.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
ja******@online .microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
From: "Rahul Agarwal" <ag***********@ hotmail.com>
References: <ur************ **@TK2MSFTNGP12 .phx.gbl> <p1************ **@cpmsftngxa06 .phx.gbl>Subject: Re: How to get access to the complete HTML just before its sent to the clientDate: Fri, 6 Aug 2004 10:47:20 +1000
Lines: 74
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <OK************ **@tk2msftngp13 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: 203.11.225.5
Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG XA01.phx.gbl!TK 2MSFTNGP08.phx. gbl!tk2msftngp1 3
..phx.gblXref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2524 80
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi Jim and Bruce

Thanks for you reply, it was a good e.g. to understand how we can get accessto the HTML just before rendering out. Can I take this a step further and
ask if it is possible that since I have access to the HTML I can add my
translation before rendering out but can I save the new HTML (with
translation) in to a Cache and for the next request just use the cache and
avoid the full page construction (rendering of each controls, etc) as I havealready got the HTML from the last request.

Is it possible and is it a good idea. The reason I am asking this that in
many of our pages we hardly use server side controls its mainly HTML
elements and we need to do some translation just before is rendered but to
improve performance can I generate the HTML once and reuse it again and
again.

Thanks a lot
Rahul Agarwal
"Jim Cheshire [MSFT]" <ja******@onlin e.microsoft.com > wrote in message
news:p1******* *******@cpmsftn gxa06.phx.gbl.. .
Hi Rahul,

You can do that using a Stream object. I have a simple sample that does
it. I've attached it.

Jim Cheshire [MSFT]
MCP+I, MCSE, MCSD, MCDBA
Microsoft Developer Support
ja******@online .microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

--------------------
>From: "Rahul Agarwal" <ag***********@ hotmail.com>
>Subject: How to get access to the complete HTML just before its sent to

the client
>Date: Thu, 5 Aug 2004 10:32:01 +1000
>Lines: 17
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <ur************ **@TK2MSFTNGP12 .phx.gbl>
>Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
>NNTP-Posting-Host: 203.11.225.5
>Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP12.phx.g bl
>Xref: cpmsftngxa06.ph x.gblmicrosoft.publ ic.dotnet.frame work.aspnet:252 243 >X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
>
>Hi
>
>In our web page we use a combination of HTML and server side controls and >some of them have a custom attribute based on which we need to find and
>replace the values once the HTML is ready.
>
>For e.g. <LABEL DICTCODE="XYZ"> Some text</LABEL>
>
>At run time just before the complete HTML is sent to the client-side Iwant >to get hold of the HTML so that I can find and replace all the HTML

elements
>with DICTCODE attribute with some custom value.
>
>Please advice.
>Thanks
>Rahul
>
>
>



Nov 18 '05 #4

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

Similar topics

35
3211
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 = 2,048,000k Let's say on average each record in the database consumes 15k 2,048,000/15 = 136,533 records
21
2146
by: Madingo | last post by:
I have been using Access 2003 for about a year and I am trying to find out how to create a web test environment to try and transition some of my Access applications on to the web. My stumbling block is that I do not know how to create the web server environment. If anyone knows of a good starting point on how to learn this it would be most appreciated because I am unsure of what questions to even ask. Regards, Bill Mahoney The Alcott...
7
6986
by: Lau Lei Cheong | last post by:
Hello, I'm using javascript's insertAdjacentHtml() to insert images to the webform at runtime. This runs fine(image successfully displayed at the browser) but when I tried to access the control's src using FindControl() function in the code-behind, it seems that the control doesn't even exist. I know that I can add controls on the server-side, but then a postback will be needed which is the thing I want to avoid. Does anyone have idea...
4
4222
by: lupo666 | last post by:
Hi everybody, this time I have three problems driving me nuts :-((( (1) I have a report with 20 or so Yes/No "squares". Is there a way to either hide/show the "square" or change the yes/no relative textbox, depending on value? (2)
0
8427
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
8851
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
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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
4175
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...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.