473,387 Members | 1,391 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,387 software developers and data experts.

Catching ChildControl render output and modify before sent out

I have a custom control which has a child control (PlaceHolder)
The placeholder will have any number of child controls added to it.

I would like to catch the rendered content of the placeholder child control
prior to it being sent to the browser and wrap all the HTML content in
document.write('') JS statements.

I'm kind of lost on how to capture the raw HTML content. (for starters :)

Any suggestions

--
Ron Vecchi

Nov 17 '05 #1
4 1368
Hi Ron,

Thank you for posting to the MSDN Managed newsgroups. We are acknowledging
your post and you should receive response from the community within 2
business days of your post.

If you have any concerns, please feel free to let us know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #2
Hi Ron,

Based on my research and experience, one way I can suggest is that you can
author your own customer control and then override the CreateChildControls
method

For more information, please check the following url.

Authoring Custom Controls
http://samples.gotdotnet.com/quickst...authoring.aspx

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #3
Actually I am within a custom control.

The control (FlashControl) will give a way to change many of the parameters
and variables to the html markup to embed the flash movie in a webpage.

One of the properties of the control is called NoFlashContent and is a
System.Web.UI.WebControl.PlaceHolder.
In the html markup of the control I output the javascript to check for the
FlashPlugin. In the JS there is an else{} statement that is called when the
FlashPlugin is not on the browser.
This is where the NoFlashContent PlaceHolder comes into play.

I would like to be able to drop controls into the placeholder (n^ deep) and
when all the controls are rendered in the PlaceHolder their HTML output will
be caught and wrapped into document.write() statements.... I was thinking
that I could just place the PlaceHolderControl between to LiteralControls
like:

LiteralControl--- document.write('
PlaceHolder
LiteralControl--- ');

But I will still need to have the raw html so I can escape(JavaScript) any
of the ' characters that might be in the rendered in the PlaceHolder Child
Controls.
I am creating the child controls in the overriden CreatChildControls memthod
but this doesn't give me the already rendered HTML of the child controls?
Thanks for you time,
Ron Vecchi
"Jacob Yang [MSFT]" <ji***@online.microsoft.com> wrote in message
news:Ut**************@cpmsftngxa06.phx.gbl...
Hi Ron,

Based on my research and experience, one way I can suggest is that you can
author your own customer control and then override the CreateChildControls
method

For more information, please check the following url.

Authoring Custom Controls
http://samples.gotdotnet.com/quickst...authoring.aspx

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #4
Hi Ron,

If I didn't misunderstand you, you want to capture the HTML contents before
they are being rendered to client.

I think the WebControl.AddAttributesToRender Method should give you the
chance to interrupt the HTML contents. Please check the following URLs for
the detailed information.

Rendering an ASP.NET Server Control
http://msdn.microsoft.com/library/de...us/cpguide/htm
l/cpconrenderingwebformscontrol.asp

WebControl.AddAttributesToRender Method
http://msdn.microsoft.com/library/de...us/cpref/html/
frlrfSystemWebUIWebControlsWebControlClassAddAttri butesToRenderTopic.asp.

Does it answer your question? If I have misunderstood your concern, please
feel free to let me know.

Best regards,

Jacob Yang
Microsoft Online Partner Support
Get Secure! ¨C www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 17 '05 #5

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

Similar topics

4
by: Ron Vecchi | last post by:
In the RenderControl() method I have some code which will catch the controls HTML output. But what I'm tring to accomplish is catching only a perticular control and its child controls. The code...
1
by: Tomas | last post by:
Is there any sequence diagram on the web that clearly shows in which order all Page methods (load, render and so on) are being called compared to the order the page's contained control methods are...
0
by: TJS | last post by:
My task is to intercept the html output and modify if a condition returns true is this possible by using overrides render if so, does anybody know of where to find a working example in vb ?
6
by: Tarren | last post by:
Hi: I have an aspx page that takes a dataset, makes the datagrid, and displays it. The new thing I have to do is take this same output and send it as an email. Is there an easy way to do...
4
by: Zuel | last post by:
Hi Folks. So I have a small problem. My DoPostBack function is not writen to the HTML page nor are the asp:buttons calling the DoPostBack. My Goal is to create a totaly dynamic web page where...
1
by: Atara | last post by:
My application starts with: Module mmcMain Public Sub Main() Debug.WriteLine("Main begin") Dim splashForm As New mcDlgs.cmcDlgSplash2 splashForm.Show() ....
0
by: Stephan Steiner | last post by:
Hi I'm trying to automate Nortel's VPN Client. Unlike their competitors, the Nortel client doesn't output the results of a connection attempt to the commandline, but instead uses PostMessage...
2
by: creative1 | last post by:
I get following error on page : Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\desiorb\411.php:9) in C:\xampp\htdocs\desiorb\411.php on line 21 when...
6
Markus
by: Markus | last post by:
Things to discuss: Headers What are they? What does PHP have to do with headers? Why can they only be sent before any output? Common causes
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.