R
Ron Vecchi
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);
c.RenderControl(htw);
StringBuilder sb = sw.GetStringBuilder();
content += sb.ToString();
}
-----------------------------------------------------
The control has two placeholders each with an infiniat ammount of child
controls, lets say PlaceHolder1 and PlaceHolder2.
I would like to loop through the controls and catch all of the child
controls of PlaceHolder1 and store the output in a string. And then catch
all of the child controls of PlaceHolder2 and store the output in a
seperater string. I was able to add an if statement that checked for the
controls ID and if it was equal to one of the two PlaceHolder ID's then it
would catch the output(none). But wouldn't catch the PlaceHolders child
controls.
Any suggestions?
Thanks
Ron Vecchi
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);
c.RenderControl(htw);
StringBuilder sb = sw.GetStringBuilder();
content += sb.ToString();
}
-----------------------------------------------------
The control has two placeholders each with an infiniat ammount of child
controls, lets say PlaceHolder1 and PlaceHolder2.
I would like to loop through the controls and catch all of the child
controls of PlaceHolder1 and store the output in a string. And then catch
all of the child controls of PlaceHolder2 and store the output in a
seperater string. I was able to add an if statement that checked for the
controls ID and if it was equal to one of the two PlaceHolder ID's then it
would catch the output(none). But wouldn't catch the PlaceHolders child
controls.
Any suggestions?
Thanks
Ron Vecchi