Microsoft Content Management Server - adding image placeholder to include map attribute

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > June 2004 > adding image placeholder to include map attribute





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author adding image placeholder to include map attribute

2004-06-20, 11:04 pm

Hi,

Is it possible to add the map attribute to the image
rendered by the image place holder control.

Thanks,

Gus
Stefan [MSFT]

2004-06-20, 11:04 pm

Hi Gus,

this can be done by implementing a custom placeholder control that derives
from the SingleImagePlaceholderControl or by using the methods described
here:
http://blogs.msdn.com/stefan_gossne.../02/106095.aspx

Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

--------------------------------


<anonymous@discussions.microsoft.com> wrote in message
news:1d53c01c45388$6ca7a400$a001280a@phx
.gbl...
> Hi,
>
> Is it possible to add the map attribute to the image
> rendered by the image place holder control.
>
> Thanks,
>
> Gus



2004-06-20, 11:04 pm

Hi Stefan,

Thanks for your reply.

Can you say how to add the attribute usemap (or any
attrbute ) to the image control with in the custom
placeholder control.

I have created a class which extends the
SingleImagePlaceHolderControl. I then overrode the method
AddAttributesToRender() and added the line

> writer.AddAttribute("usemap","#mapdef");


However this adds the attrtibute to the span tag and not
the image tag.

I also do not see how to access the controls with in the
palceholder control.

Many thanks,

Gus


>-----Original Message-----
>Hi Gus,
>
>this can be done by implementing a custom placeholder

control that derives
>from the SingleImagePlaceholderControl or by using the

methods described
>here:
>http://blogs.msdn.com/stefan_gossne...e/2004/04/02/10

6095.aspx
>
>Cheers,
>Stefan.
>
>--
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>MCMS FAQ:
>http://download.microsoft.com/download/4/2/5/4250f79a-

c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
>MCMS Blog:

http://blogs.msdn.com/stefan_gossner/category/4983.aspx
>MCMS Sample Code:
>http://www.gotdotnet.com/community/...les/Default.asp

x? ProductDropDownList=Content+Management+S
erver
>--------------------------------
>
>
><anonymous@discussions.microsoft.com> wrote in message
> news:1d53c01c45388$6ca7a400$a001280a@phx
.gbl...
>
>
>.
>

Stefan [MSFT]

2004-06-20, 11:04 pm

Hi Gus,

you need to overwrite the Render method, consume the rendered html stream
and then inject the attribute into the stream at the right place.
You can use the code below as a starter:

protected override void Render(System.Web.UI.HtmlTextWriter output)
{
if (WebAuthorContext.Current.Mode == ...correct mode...)
{
// catch the output of the original HtmlPlaceholderControl
TextWriter tempWriter = new StringWriter();
base.Render(new System.Web.UI.HtmlTextWriter(tempWriter));

string orightml= tempWriter.ToString();

// modify the stream
string newhtml = modify(orightml);

output.Write(newhtml);
}
else
{
base.Render(output);
}



}


Cheers,
Stefan.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

MCMS FAQ:
http://download.microsoft.com/downl...6a/MCMS+2002+-+(complete)+FAQ.htm
MCMS Blog: http://blogs.msdn.com/stefan_gossner/category/4983.aspx
MCMS Sample Code:
http://www.gotdotnet.com/community/...t+S
erver

MCMS Whitepapers and other docs:
http://blogs.msdn.com/stefan_gossne...2/07/41859.aspx
--------------------------------


<anonymous@discussions.microsoft.com> wrote in message
news:1d6ab01c4545e$077c1d50$a601280a@phx
.gbl...[vbcol=seagreen]
> Hi Stefan,
>
> Thanks for your reply.
>
> Can you say how to add the attribute usemap (or any
> attrbute ) to the image control with in the custom
> placeholder control.
>
> I have created a class which extends the
> SingleImagePlaceHolderControl. I then overrode the method
> AddAttributesToRender() and added the line
>
>
> However this adds the attrtibute to the span tag and not
> the image tag.
>
> I also do not see how to access the controls with in the
> palceholder control.
>
> Many thanks,
>
> Gus
>
>
> control that derives
> methods described
> 6095.aspx
> confers no rights.
> c3a1-4003-9272-2404e92bb76a/MCMS+2002+-+(complete)+FAQ.htm
> http://blogs.msdn.com/stefan_gossner/category/4983.aspx
> x? ProductDropDownList=Content+Management+S
erver


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com