Home All Groups Group Topic Archive Search About

Using SkinID for Menu background image.

Author
8 Nov 2006 6:37 AM
Mr. Kiran More - India
Hi,

I am using dot net 2.0. It is with a new tag - MENU. Also THEMES are available.

I have defined four themes BLUE, RED, GREEN & KHAKI. Under every theme one skin file is defined. Inside every skin file, various SkinID's are defined that points to images related to that theme.

If I have to include that image inside my page, I use "asp:Image ID=imgTopLogo SkinID=TopLogo runat=server" kind of code.

Now, I want to use SkinID element to set the background to the asp:menuitem tag. I am unable to find the property of MENU tag where I can assign that SkinID.

Please help me in this.
my email id is
kiran_more_***@yahoo.com

Kiran

Author
8 Nov 2006 3:19 PM
David Longnecker
In your .skin file for the Menu (ex: Menu.skin), you define the background
and other characteristics of MenuItems based on the Menu tag itself:

---
<asp:Menu runat="server" SkinId="redMenu">
  <StaticMenuItemStyle ... />
  <DynamicMenuItemStyle ... />

  <DynamicHoverStyle ... />
  <StaticHoverStyle ... /> 

</asp:Menu>
---

Then call that from your presentation page:
---
    <asp:Menu ID="myMenu" runat="server" SkinID="redMenu">
    <Items>
        <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home Page" Value="Home
Page" />
    </Items>
    </asp:Menu>
---

or programatically assign it in codebehind prior to the page's generation:
---
protected void Page_PreInit(object sender, EventArgs e)
    {
        myMenu.SkinID = "redMenu";
    }
---

-dl

---
David Longnecker
Web Developer
http://blog.tiredstudent.com

Show quoteHide quote
> Hi,
>
> I am using dot net 2.0. It is with a new tag - MENU. Also THEMES are
> available.
>
> I have defined four themes BLUE, RED, GREEN & KHAKI. Under every theme
> one skin file is defined. Inside every skin file, various SkinID's are
> defined that points to images related to that theme.
>
> If I have to include that image inside my page, I use "asp:Image
> ID=imgTopLogo SkinID=TopLogo runat=server" kind of code.
>
> Now, I want to use SkinID element to set the background to the
> asp:menuitem tag. I am unable to find the property of MENU tag where I
> can assign that SkinID.
>
> Please help me in this.
> my email id is
> kiran_more_***@yahoo.com
> Kiran
>
Author
9 Nov 2006 7:26 AM
Kiran More
Hey David,
Thanks for the reply.

Kiran More
Author
11 Nov 2006 4:38 AM
kiran more
its not that much easy....
i have defined on class inside the css file and used that as CSSClass for StaticMenuItemStyle tag.

kiran more