CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: NewsGroup Date Entered: 12/21/2006 4:12:44 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 12 Views: 117 Favorited: 0 Favorite
13 Items, 1 Pages 1 |< << Go >> >|
sunuantony
Asp.Net User
Background image for a asp.net menu12/21/2006 4:12:44 AM

0

How to put background image for asp.net 2.0 menu and menuitem?
sathesh.mani
Asp.Net User
Re: Background image for a asp.net menu12/21/2006 2:58:57 PM

0

You need to do add the image through a CSS style. Look for the
background-image attribute. Here's a quick example.

<%@ Page Language= "VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<style type="text/css">
.menuItem
{
color:black;
border:Solid 1px Gray;
background-color:#c9c9c9;
background-image : url(ur Gif Image url);
padding:2px 5px;
}
</style>
<title>Menu Templates</title>
</head>
<body>
<form id="form1" runat="server">
<div>

<asp:Menu
id="Menu1"
Orientation="Horizontal"
StaticMenuItemStyle-CssClass="menuItem"
DynamicMenuItemStyle-CssClass="menuItem"
Runat="server">

<Items>
<asp:MenuItem Text="Item1">
<asp:MenuItem Text="Item2" />
<asp:MenuItem Text="Item3" />
</asp:MenuItem>
<asp:MenuItem Text="Item4">
<asp:MenuItem Text="Item5">
<asp:MenuItem Text="Item6" />
<asp:MenuItem Text="Item7" />
</asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>

</div>
</form>
</body>
</html>

 


Hope this helps.
cnobles
Asp.Net User
Re: Background image for a asp.net menu12/28/2006 11:10:12 PM

0

I'm using stylesheets to add background images to my menu items, but I've come across an interesting bug that I haven't been able to figure out.  For some reason the image is showing up as the background for the item, and for the text within the item.  It ends up looking like a box inside a box, when all I want is the image to show for the main item itself.  Any suggestions?

 Here is the code I'm using:

 

<

asp:Menu SkinId="SubMenu" runat="server" Orientation="Horizontal" BackColor="#A2ABB0"

Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black">

<StaticMenuItemStyle CssClass="SubMenuItem" HorizontalPadding="14px" VerticalPadding="2px" />

<StaticSelectedStyle CssClass="SubMenuItemSelected" ForeColor="#996600" Font-Bold="True"/>

<StaticHoverStyle CssClass="SubMenuItemSelected" />

<DynamicMenuStyle BackColor="#A2ABB0" />

<DynamicMenuItemStyle CssClass="SubMenuItem" HorizontalPadding="14px" VerticalPadding="2px" />

<DynamicSelectedStyle CssClass="SubMenuItemSelected" ForeColor="#996600" Font-Bold="True"/>

<DynamicHoverStyle CssClass="SubMenuItemSelected" />

</

asp:Menu>

 

.SubMenuItem

{

background-color: #CCCCCC;

background-image: url(images/tab-n.gif);

}

.SubMenuItemSelected

{

background-color: #A2ABB0;

background-image: url(images/tab-o.gif);

}

cnobles
Asp.Net User
Re: Background image for a asp.net menu12/28/2006 11:11:55 PM

0

I'm using stylesheets to add background images to my menu items, but I've come across an interesting bug that I haven't been able to figure out.  For some reason the image is showing up as the background for the item, and for the text within the item.  It ends up looking like a box inside a box, when all I want is the image to show for the main item itself.  Any suggestions?

 Here is the code I'm using:

 

<

asp:Menu SkinId="SubMenu" runat="server" Orientation="Horizontal" BackColor="#A2ABB0"

Font-Names="Tahoma" Font-Size="8pt" ForeColor="Black">

<StaticMenuItemStyle CssClass="SubMenuItem" HorizontalPadding="14px" VerticalPadding="2px" />

<StaticSelectedStyle CssClass="SubMenuItemSelected" ForeColor="#996600" Font-Bold="True"/>

<StaticHoverStyle CssClass="SubMenuItemSelected" />

<DynamicMenuStyle BackColor="#A2ABB0" />

<DynamicMenuItemStyle CssClass="SubMenuItem" HorizontalPadding="14px" VerticalPadding="2px" />

<DynamicSelectedStyle CssClass="SubMenuItemSelected" ForeColor="#996600" Font-Bold="True"/>

<DynamicHoverStyle CssClass="SubMenuItemSelected" />

</

asp:Menu>

 

.SubMenuItem

{

background-color: #CCCCCC;

background-image: url(images/tab-n.gif);

}

.SubMenuItemSelected

{

background-color: #A2ABB0;

background-image: url(images/tab-o.gif);

}

cnobles
Asp.Net User
Re: Background image for a asp.net menu12/28/2006 11:13:35 PM

0

Sorry about the double post.  I hit it once and got 2 somehow.
leoforio
Asp.Net User
Re: Background image for a asp.net menu1/20/2007 5:50:06 PM

0

I have been having the same problems. Did you solve it and how

 

Regards leoforio

 

Zhao Ji Ma - MS
Asp.Net User
Re: Background image for a asp.net menu1/23/2007 9:49:26 AM

0

Hi,

ASP.NET menuitem have imageurl and popoutimageurl property. This might be what you want.

        <items>
          <asp:menuitem navigateurl="Home.aspx"
            text="Home"
            imageurl="Images\Home.gif"
            popoutimageurl="Images\Popout.jpg"  
            tooltip="Home"/>

        </items>
     
      </asp:menu>

Hope this helps


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
Kafil Jairajpur
Asp.Net User
Re: Background image for a asp.net menu1/31/2007 10:02:04 AM

0

I am also having the same probem

any help?

GeorgeZ
Asp.Net User
Re: Background image for a asp.net menu2/1/2007 8:17:40 AM

0

Hi,

asp.net Menu control works well with css background or background-image, since your css files are usually put into App_Themes/ThemeName/ folder, so you need to set correct url of background-image from your css file to your image. Assuming the images folder is under root folder of your asp.net web application, then the relative path to your image should be ../../images/tab-n.gif, not images/tab-n.gif, alternatively you can use absolute url instead. 

Good Luck. 


Zhao Ji Ma - MS
Asp.Net User
Re: Background image for a asp.net menu2/1/2007 8:29:40 AM

0

Hi

http://forums.asp.net/thread/1553267.aspx

hope this helps!


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
kaista
Asp.Net User
Re: Background image for a asp.net menu2/18/2007 6:03:25 PM

0

cnobles:

I'm using stylesheets to add background images to my menu items, but I've come across an interesting bug that I haven't been able to figure out.  For some reason the image is showing up as the background for the item, and for the text within the item.  It ends up looking like a box inside a box, when all I want is the image to show for the main item itself.  Any suggestions?

Hi im having the same problem with my menu control, I have set the staticmenustyle up to use a css style with a background-image and that works great but my hover and select styles use the background twice, almost like its being inherited. So my green gradient image which is used for selected items has a perfect background but then is repeated with the same left and top values as the text i've placed on the button. I've tried lots of different things including setting the actual staticmenuitemstyle to background-image none !important to override any inheritance but with no luck.. Please HELP!

kaista
Asp.Net User
Re: Background image for a asp.net menu2/19/2007 12:25:42 PM

0

Hi everyone, I have the solution to this problem:

Say you have a statichoverstyle css class for your hover style, you have to add two more css style rules to force the textbox to stop using the menu's background:

menu_onhover {

background-image: url('image'); 

}

Here's the fix

 

menu_onhover A:link {

background-image: none

}

menu_onhover A:visited {

background-image: none;

}

set your statichoverstyle on your asp.net menu control to menu_onhover and voila!

This should fix your problems (took me days to find this fix, but it works GREAT!)

hope it helps.

Zhao Ji Ma - MS
Asp.Net User
Re: Background image for a asp.net menu2/25/2007 11:55:53 AM

0

Hi, 

You use the ResolveClientUrl method to return a URL string suitable for use by the client to access resources on the Web server, such as image files, links to additional pages, and so on.

http://msdn2.microsoft.com/en-us/library/system.web.ui.control.resolveclienturl.aspx

http://www.pluralsight.com/blogs/fritz/archive/2006/02/06/18596.aspx


Zhao Ji Ma
Sincerely,
Microsoft Online Community Support

?Please remember to click ?Mark as Answer? on the post that helps you, and to click ?Unmark as Answer? if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ?
13 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Beginning ASP.NET 2.0 databases: beta preview Authors: John Kauffman, Thiru Thangarathinam, Pages: 404, Published: 2005
Professional ASP.NET 2.0 Design: CSS, Themes, and Master Pages Authors: Jacob J. Sanford, Pages: 474, Published: 2007
Wrox's Visual Basic 2005 Express Edition Starter Kit Authors: Andrew Parsons, Pages: 358, Published: 2006
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Beginning DotNetNuke Skinning and Design Authors: Andrew Hay, Shaun Walker, Pages: 400, Published: 2007

Web:
background image for menu control in ASP.NET 2.0? Talk about background image for menu control in ASP.NET 2.0?
Background image for a asp.net menu - ASP.NET Forums asp.net Menu control works well with css background or background-image, since your css files are usually put into App_Themes/ThemeName/ ...
ASP.NET Menu Control On this example you can see the Menu with background image. To achieve this, you need to customize the CSS Style. CSS /*Main Menu Parent Table*/ . ...
background image for menu control in ASP.NET 2.0? is it possible to add a background image to the menu items? ... Let us know if this helps? > > Ken > Microsoft MVP [ASP.NET] ...
ASP.Net Menu Control background image with CssClass : menu ... Sep 29, 2007 ... Hi, Trying to place a backround image for StaticMenuItemStyle, StaticHoverStyle & StaticSelectedStyle by using the CssClass property.

Menu Control, StaticHoverStyle issue with image background - ng ... css background-image and menu control - ASP.NET Forums I have a menu control and i want to use css to set a background image for each . ...
asp.net menu control when using a StaticItemTemplate; does not ... asp.net menu control when using a StaticItemTemplate; does not respond to ... background-image: url(Images/m32.gif);" BorderWidth="0px" ...
want asp menu control to work onclick instead of mouse over. - ng ... background-image:url(images/menudiv1bg.gif); margin-left:25px; .... We are using asp.net Menu control and wanted to have some delay . ...
How to left align text in control? - ng.asp-net-forum ... Is there a way to align an ASP.NET Menu Control (horizontal) to the right ... SitePoint Forums - Background image with menu control ...
Problem with ASP.Net menu control - leaving a top margin of about ... I am trying to use the asp.net menu control in order to create a horizontal menu made up of images. .... how to set background image in menuitem? ...






creative minds

live chat module for dnn?

c# modules inheriting dotnetnuke.portalmodulecontrol

componentart releasing webui 3.0 suite

error! how can i solve that ?

login to dnn and automaticaly login into to another app info request

java applets

error - multiple languages 1.0.10 xxl

dnn2 - where is it?

dnn 3.1.0 new install. just rename release.config to web.comfig?

dotnetnuke 3.0 release

response.redirect()....

filemanager upload issue

2.1.2 install not populating tables

display module on all tabs but not in a single tab.

limiting scheduler thread to one

image placeholder 3.0.11

error dnn2

delay in displaying admin dropdown

upgrade from 3.0.12 to 3.1.0

why aspnetmenu?

question about pa install

microsoft.scalablehosting.profile.sqlprofileprovider does not fit into one to many relationship

dnn 3.0.10 - web.config changes [core team question]

problem with dynamic load user control and localization

2.0.(5?), css - not skin - not container - but, prefix attrib in "module settings"

fao: the owner of dotnetnukeskin.com

gallery and forum/blog modules

dnn 3.3/4.1 when?

visual studio error

   
  Privacy | Contact Us
All Times Are GMT