webpartzone: set backgroundimage for MenuVerbHoverStyle

M

Marc

Dear all

I try to set the CSSClass in the MenuVerbHoverStyle Property of the
webpartzone. This is not possible and the kb article
http://support.microsoft.com/kb/911717/en-us validates this.

The workaround proposed there does not work, because the Style class does
not have a backgroudimage property.

Can you provide me with a workaround?

Thanks in advance for your help,

Marc
 
A

Allen Chen [MSFT]

Hi Marc,
From your description you want to set background image for the MenuPopup.
If so you can try this:

<MenuPopupStyle BackImageUrl="image_url_here"/>

The MenuPopupStyle has no backgroudimage property but it has BackImageUrl
property for you to specify the image url.

Please have a try and feel free to let me know if you need further
assistance.

Regards,
Allen Chen
Microsoft Online Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| Thread-Topic: webpartzone: set backgroundimage for MenuVerbHoverStyle
| thread-index: AckCznrb+iBExI4WSh6ph/DRM6wsTA==
| X-WBNR-Posting-Host: 207.46.193.207
| From: =?Utf-8?B?TWFyYw==?= <[email protected]>
| Subject: webpartzone: set backgroundimage for MenuVerbHoverStyle
| Date: Wed, 20 Aug 2008 07:10:20 -0700
| Lines: 15
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:3933
| NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Dear all
|
| I try to set the CSSClass in the MenuVerbHoverStyle Property of the
| webpartzone. This is not possible and the kb article
| http://support.microsoft.com/kb/911717/en-us validates this.
|
| The workaround proposed there does not work, because the Style class does
| not have a backgroudimage property.
|
| Can you provide me with a workaround?
|
| Thanks in advance for your help,
|
| Marc
|
|
 
M

Marc

Hi Allen

thanks for your reply. I'm looking for setting a background image for the
Style MenuVerbHoverStyle - this means I would like to highlight the verb in
the popup when the user hovers.

I would like to use this css code:

.VerbStyle
{
background-image: url(day_header_active.jpg);
background-repeat: repeat-x;
background-position:0;

}

Kind regards,

Marc
 
A

Allen Chen [MSFT]

Hi Marc,
Thanks for your clarification. I understand you're looking for something
like:
<MenuVerbHoverStyle BackgroundImage="¡­" />.

Based on my research, it's not easy to achieve. I think I need some time to
research on this issue. I'll get back to you if I found anything valuable.

If you have any new findings please do let me know so that we may come up
with a workaround.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: webpartzone: set backgroundimage for MenuVerbHoverStyle
| thread-index: AckDXcPVkLwwFPmUTXODaEOQXscdGA==
| X-WBNR-Posting-Host: 207.46.19.197
| From: =?Utf-8?B?TWFyYw==?= <[email protected]>
| References: <[email protected]>
<#[email protected]>
| Subject: RE: webpartzone: set backgroundimage for MenuVerbHoverStyle
| Date: Thu, 21 Aug 2008 00:16:00 -0700
| Lines: 19
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:3935
| NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi Allen
|
| thanks for your reply. I'm looking for setting a background image for the
| Style MenuVerbHoverStyle - this means I would like to highlight the verb
in
| the popup when the user hovers.
|
| I would like to use this css code:
|
| .VerbStyle
| {
| background-image: url(day_header_active.jpg);
| background-repeat: repeat-x;
| background-position:0;
|
| }
|
| Kind regards,
|
| Marc
|
 
A

Allen Chen [MSFT]

Hi Marc,
I found a way to achieve your requirement. Here it is:

<asp:WebPartManager ID="WebPartManager1" runat="server">
</asp:WebPartManager>
<asp:WebPartZone ID="WebPartZone1" runat="server" >

<ZoneTemplate>
<asp:calendar id="cal1" runat="server" />

</ZoneTemplate>
</asp:WebPartZone>

namespace WebPartZoneTest
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected override void Render(HtmlTextWriter writer)
{
base.Render(writer);
Literal l = new Literal();

l.Text = @"<script type='text/javascript'>
menuWebPart_gwpcal1Verbs.itemHoverStyle =
'background-image:url(1.jpg);';
</script>";//the image url may need to be changed in your
case
l.RenderControl(writer);
}

}
}

I'll try to continue my research to see if I can find a better workaround.
Keep contact, Marc.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: webpartzone: set backgroundimage for MenuVerbHoverStyle
| thread-index: AckDXcPVkLwwFPmUTXODaEOQXscdGA==
| X-WBNR-Posting-Host: 207.46.19.197
| From: =?Utf-8?B?TWFyYw==?= <[email protected]>
| References: <[email protected]>
<#[email protected]>
| Subject: RE: webpartzone: set backgroundimage for MenuVerbHoverStyle
| Date: Thu, 21 Aug 2008 00:16:00 -0700
| Lines: 19
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:3935
| NNTP-Posting-Host: tk2msftsbfm01.phx.gbl 10.40.244.148
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi Allen
|
| thanks for your reply. I'm looking for setting a background image for the
| Style MenuVerbHoverStyle - this means I would like to highlight the verb
in
| the popup when the user hovers.
|
| I would like to use this css code:
|
| .VerbStyle
| {
| background-image: url(day_header_active.jpg);
| background-repeat: repeat-x;
| background-position:0;
|
| }
|
| Kind regards,
|
| Marc
|
 
M

Marc

Hi Allen

yes, a feature like:
<MenuVerbHoverStyle BackgroundImage="¡­" />.

would be helpful. Best would be, if the avaiable CssClass property would
work - this would give the biggest amount of flexibility.

If I find a workaround I will surely post it. Thanks in advance for your
support!

Kind regards,

Marc
 
M

Marc

Hi Allen

Thanks for this workaround!
I tried it but have some problems with the name of the
menuWebPart_gwpcal1Verbs.itemHoverStyle. My app reports the following error:
"Microsoft JScript runtime error: 'menuWebPart_gwpcal1Verbs' is undefined"

Because I'm in a masterpage szenario - I guess I have to take account of the
special naming. To what does the name menuWebPart_gwpcal1Verbs refer?
- cal1 is your calender - why is this important? the MenuVerbHoverStyle is a
property of a webpartzone.
- menuWebPart: to what does this refer?
- gwp: to what does this refer?

Kind regards,

Marc
 
A

Allen Chen [MSFT]

Hi Marc,

Quote from Marc==================================================
To what does the name menuWebPart_gwpcal1Verbs refer?
- cal1 is your calender - why is this important? the MenuVerbHoverStyle is
a
property of a webpartzone.
- menuWebPart: to what does this refer?
- gwp: to what does this refer?
==================================================

All above are generated by WebPartZone. When you view the source of the
page you can see following JavaScript code:
<script type="text/javascript">
var menuWebPart_gwpcal1Verbs = new
WebPartMenu(document.getElementById('WebPart_gwpcal1Verbs'),
document.getElementById('WebPart_gwpcal1VerbsPopup'),
document.getElementById('WebPart_gwpcal1VerbsMenu'));
menuWebPart_gwpcal1Verbs.itemStyle = '';
menuWebPart_gwpcal1Verbs.itemHoverStyle = '';
menuWebPart_gwpcal1Verbs.labelHoverColor = '';
menuWebPart_gwpcal1Verbs.labelHoverClassName = '';
</script>
The name is hard coded and has no special meaning.


Quote from Marc ==================================================
Because I'm in a masterpage scenario - I guess I have to take account of
the
special naming.
==================================================

I tested it in a masterpage scenario and it works. I wonder if you're using
FireFox or IE (or other browsers). Currently the WebParts verb menu is only
supported in IE. If you're using IE please send a demo project to me. I'll
try to find the root cause. My email is (e-mail address removed).
You're welcome to send a feature request in the Connect if you want
WebParts verb menu to be supported in FireFox in the future:
http://connect.microsoft.com/VisualStudio/Feedback
It will help us to make our products better.

Regards,
Allen Chen
Microsoft Online Support

--------------------
| Thread-Topic: webpartzone: set backgroundimage for MenuVerbHoverStyle
| thread-index: AckEMP01e4btW06NRw2w4IoaWyrJOw==
| X-WBNR-Posting-Host: 207.46.19.168
| From: =?Utf-8?B?TWFyYw==?= <[email protected]>
| References: <[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
| Subject: RE: webpartzone: set backgroundimage for MenuVerbHoverStyle
| Date: Fri, 22 Aug 2008 01:28:01 -0700
| Lines: 17
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3119
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
| Path: TK2MSFTNGHUB02.phx.gbl
| Xref: TK2MSFTNGHUB02.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontrols:3943
| NNTP-Posting-Host: tk2msftibfm01.phx.gbl 10.40.244.149
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
|
| Hi Allen
|
| Thanks for this workaround!
| I tried it but have some problems with the name of the
| menuWebPart_gwpcal1Verbs.itemHoverStyle. My app reports the following
error:
| "Microsoft JScript runtime error: 'menuWebPart_gwpcal1Verbs' is undefined"
|
| Because I'm in a masterpage szenario - I guess I have to take account of
the
| special naming. To what does the name menuWebPart_gwpcal1Verbs refer?
| - cal1 is your calender - why is this important? the MenuVerbHoverStyle
is a
| property of a webpartzone.
| - menuWebPart: to what does this refer?
| - gwp: to what does this refer?
|
| Kind regards,
|
| Marc
|
 
M

Marc

Hi Allen

Thanks! Now it works - needed to understand where the name
menuWebPart_gwpcal1Verbs comes from. I came up with this code for my project

protected override void Render(HtmlTextWriter output)
{
base.Render(output);

foreach (WebPartZone z in wpzList)
{
foreach (WebPart p in z.WebParts)
{
StringBuilder sb = new StringBuilder();
sb.Append(@"<script type='text/javascript'>");
sb.Append("menuWebPart_");
sb.Append(p.ID);
sb.Append("Verbs.itemHoverStyle = ");

sb.Append("'background-image:url(webPartTitle.jpg);';</script>");

Literal l = new Literal();
l.Text = sb.ToString();
l.RenderControl(output);
}
}
}

Best Regards,

Marc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top