Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 19th, 2005, 09:01 AM
Authorized User
 
Join Date: Apr 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Replace string with a control

If I have an HTML string, like "<HTML><BODY><CONTROL:ADD/></BODY></HTML>"

and I wanted to find the "<CONTROL:ADD/>" and replace it (At runtime) with an actual control, how would I do that?

The end idea is to have the HTML displayed to the page of course...
thanks


 
Old August 19th, 2005, 11:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Use the add method of the page:

Me.FindControl("Form1").Controls.Add(myControl)

 
Old August 22nd, 2005, 02:59 AM
Authorized User
 
Join Date: Apr 2005
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HI thanks,

The only thing is that I cant add it directly to the page because it has to come in that specific place in the string so tecnically I have to "add it to the string" in a sence then add it all at once to the page. I also cant just add the first part of the string to the page then add the control then carry on, because there may be another control to be added before that one in the string...

Am I making sence?

 
Old August 22nd, 2005, 09:20 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

That is a difficult requirement. I would place a table on the page, and then add controls to it depending on where you neede them.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple String Replace berna_isct XSLT 5 May 20th, 2008 02:47 AM
Help in instruction string-replace hugoscp XML 9 October 20th, 2006 12:07 PM
replace string value str33ts XSLT 1 April 22nd, 2005 04:01 AM
how to replace a string with another string/number crmpicco Javascript How-To 4 March 14th, 2005 12:59 PM
String.replace() method JohnD Javascript 0 August 20th, 2004 06:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.