473,803 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Manipulating HTML Output of Placeholder and Child Controls

Hi all.

I am filling some stuff into a PlaceHolder Control in my
WebForm, i.e. UserControls and WebControls. So far so good.

Now I want to manipulate the HTML output of this control
and its child controls. I want to parse the HTML code for
hyperlinks by regular expressions to extract them and
display them seperately in a print mode of a webpage
(as you can see it on
http://www.heise.de/english/newsticker/news/print/69361
(scroll down)).

I know a solution for parsing the whole output by a
HttpModule, but I don't want to parse all the contents.

So, how can I do this?

To simplify it - the challange is to change the Text of

Literal text = new Literal();
text.Text = "Hallo";
PH.Controls.Add (text);

without touching the Text property of the Control
before sending it to the client ;-)

Regards, Thomas
http://blog.thomasbandt.de/
Feb 8 '06 #1
2 1560
Find the HTML in PreRender and manipulate it the way you need it.

Sonu Kapoor [MVP]
---
Posted via www.DotNetSlackers.com
Feb 9 '06 #2
Sonu Kapoor schrieb:
Find the HTML in PreRender and manipulate it the way you need it.


First class answer! Thank you very much.

And how, please???

Thomas
Feb 9 '06 #3

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

Similar topics

1
1749
by: Barb Alderton | last post by:
I am working with SharePoint 2003. I am using an existing webpart as a child control (server control). I need to access/manipulate the HTML that the control outputs prior to rendering it to the the page. The control outputs a list in a one-column table format. I need to access the contents of the rows and output them with restrictions in my own table format. Do you have any examples of manipulating the HTML of a server control prior to...
2
4033
by: John | last post by:
Hi all, How do I iterate through a specific placeholder and remove or hide all controls contained within that placeholder? Regards John.
4
1279
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 below catches everything. ---------------------------------------------------- string content ""; foreach(Control c in this.Controls) { StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw);
2
4959
by: Brett Robichaud | last post by:
I'm trying to create a Page class that I derive all others from. This page class will look for an asp:placeholder and insert some html at that point. I can see how I can create new HTML controls in code and then add them to the placeholders Controls container. But is there any way I can use Response.Write() to output some html directly before of after this placeholder? What I was after is something like a InnerHtml method, but I see...
3
3687
by: Simon Harvey | last post by:
Hi All I am making a particular asp.net page using the codebehind method. What I need to do is write out html in the code behind into a specific place in the page. Somewhat like the way Servlets work. I have a couple of questions I hope someone can help with: 1. Can I output html by doing something like Response.out.write("<b>"); and is this the best way to do it
1
5378
by: Angel | last post by:
I have added controls to the placeholder control. All the controls that were added have EnableViewState = true including the placeholder. One of the controls has a button that performs a postback. My question is when the button is clicked and a postback is performed, the controls that were in the placeholder no longer appears on the screen! Am I doing something wrong here? Why are the controls back on the screen eventhough they have enable view...
1
1773
by: msnews.microsoft.com | last post by:
I'm adding multiple web controls to the placeholder controls collection, but even when doing the for each and recursion method of getting the web controls, I'm only getting the first web control that was added, and none of the others. I've tried add and addat methods when adding the controls, but while they appear on the form, only the first one can be retrieved. Is there some better documentation anyone could send me? -Max
20
5654
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
1
1796
by: John | last post by:
I am trying to get a control to insert into the HTML content for a page which comes from our database. At the point I have a tag for the component I want to add which is contained inside the HTML. I have tried to insert the control into a placeholder with no joy. I want to have something similar to DotNetNukes way of adding content to a page. Does anyone have any ideas how to do this or where I'm going wrong? What I have so far :...
0
9565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10550
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
10317
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
10295
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
10069
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
9125
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
7604
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...
1
4275
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2972
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.