Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placeholders: getting inner HTML.

Status
Not open for further replies.

Caradog

Programmer
Jun 28, 2000
73
0
0
GB
Hi, I'm trying to get all the HTML written inside a placeholder control in an .aspx then, then duplicate it x number of times. E.g., this is my example placeholder below, I want to grab everything inside this control, maybe monkey around with it, then duplicate it a few times. Possible?

<asp:placeHolder ID="plcTemplate" Runat="server">
<TABLE cellSpacing="1" cellPadding="1" width="165" border="1">
<TR vAlign="top" align="left">
<TD>Make / Model
</TD>
</TR>
<TR vAlign="top" align="left">
<TD>Category<BR>
Descripion
</TD>
</TR>
</TABLE>
</asp:placeHolder>
 
Don't try to get the HTML just use the Controls collection of the placeholder.

You need to make copies of the controls prior to changing them. Use the CopyTo method of the Controls collection to save them in an array, change the controls there and then add them to the Controls collection of another placeholder.


Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top