11-16-05 12:52 PM
Hi Joe,
to achieve this you would need to create a custom placeholder control that
derives from the original SingleImagePlaceholderControl.
In your custom placeholder control you need to override the Render method,
consume the generated html and remove the unwanted tags.
Then return the modified html as a result of the Render method.
This would look like the following:
protected override void Render(System.Web.UI.HtmlTextWriter output)
{
if ((WebAuthorContext.Current.Mode !=
WebAuthorContextMode.AuthoringReedit)
&&(WebAuthorContext.Current.Mode != WebAuthorContextMode.AuthoringNew))
{
// catch the output of the original HtmlPlaceholderControl
TextWriter tempWriter = new StringWriter();
base.Render(new System.Web.UI.HtmlTextWriter(tempWriter));
string orightml= tempWriter.ToString();
// remove the unwanted tags
string newhtml = orightml.Replace(...);
output.Write(newhtml);
}
else
{
base.Render(output);
}
}
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
Check out the new book as well: Advanced MCMS development:
http://tinyurl.com/8ugwj
----------------------
"Joe C" <JoeC@discussions.microsoft.com> wrote in message
news:CFC0507D-6D44-4970-83F4-93C9EBC3A027@microsoft.com...
> It seems that the SingleImagePlaceholder always renders to three tags in
> the
> following structure:
> <span><a ..><img /></a> </span>
> Is there a way that I can force it to not render the <a> tag? Even when I
> set the 'allow hyperlinks' property on the placeholder, I still get this
> <a>
> tag.
>
> Thanks
> Joe
[ Post a follow-up to this message ]
|