473,473 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Create 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 1736
this is what httpmodules are for.
"Rahul Agarwal" <ag***********@hotmail.com> wrote in message
news:ur**************@TK2MSFTNGP12.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******@online.microsoft.com> wrote in message
news:p1**************@cpmsftngxa06.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.public.dotnet.framework.aspnet
NNTP-Posting-Host: 203.11.225.5
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:252243X-Tomcat-NG: microsoft.public.dotnet.framework.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.public.dotnet.framework.aspnet
NNTP-Posting-Host: 203.11.225.5
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13
..phx.gblXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:252480
X-Tomcat-NG: microsoft.public.dotnet.framework.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******@online.microsoft.com> wrote in message
news:p1**************@cpmsftngxa06.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.public.dotnet.framework.aspnet
>NNTP-Posting-Host: 203.11.225.5
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP12.phx.gbl
>Xref: cpmsftngxa06.phx.gblmicrosoft.public.dotnet.framework.aspnet:252243 >X-Tomcat-NG: microsoft.public.dotnet.framework.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
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 =...
21
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...
7
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...
4
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
0
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,...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.