By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,544 Members | 2,002 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,544 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.