Hello, I'd like to know if it's possible to get a reference to all img controls on a page though the renderchildren method. Basically, I'm trying to seek the img tags to manually resolve their ~ path... This is the code I have so far...
override protected void RenderChildren(System.Web.UI.HtmlTextWriter writer)
{
IterateControls(this);
base.RenderChildren(writer);
}
private void IterateControls(Control objCTRL)
{
if (objCTRL is LiteralControl)
CheckForWildCard((LiteralControl)objCTRL);
if (objCTRL.HasControls())
{
foreach(Control ctrl in objCTRL.Controls)
IterateControls(ctrl);
}
}
private void CheckForWildCard(LiteralControl objCtrl)
{
// No img controls reach this point
string sNewText = objCtrl.Text;
sNewText = sNewText.Replace("~", Request.ApplicationPath);
objCtrl.Text = sNewText;
}