CodeVerge.Net Beta


   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: > Asp.Net Forum > general_asp.net.master_pages_themes_and_navigation_controls Tags:
Item Type: Date Entered: 2/13/2006 10:41:11 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 2 Views: 53 Favorited: 0 Favorite
3 Items, 1 Pages 1 |< << Go >> >|
"kiteboardertje
NewsGroup User
Menu style problem2/13/2006 10:41:11 AM

0

I have made a Menu with code behind. Now i try to set the Color properties for the different front colors this There is no difference on adding these codes :

<asp:Menu ID="Mymenu" runat="server"

Font-Size="8"

StaticMenuItemStyle-ItemSpacing="100"

StaticDisplayLevels="1"

DynamicEnableDefaultPopOutImage="false"

StaticEnableDefaultPopOutImage="false"

Orientation="Horizontal"

ForeColor="White"

DynamicHoverStyle-BackColor="#933E8F"

DynamicHoverStyle-ForeColor="#153862"

DynamicMenuItemStyle-BackColor="#D3D3D3"

StaticHoverStyle-BackColor="#933E8F"

StaticHoverStyle-ForeColor="White"

DynamicMenuItemStyle-ForeColor="White" >

</asp:Menu>

 

does any one have a suggestion what could be wrong?

this is how i fill the menu:

Public Function Menu() As Long

Dim oConn As SqlConnection

Dim sqlCmd As SqlCommand

Dim sdrData As SqlDataReader

Dim sLogin As String

Dim imnuid As Integer

Dim sMenu As String

Dim sPage As String

Dim iSubMenu As Integer

Dim sSubMenu As String

Dim sRights As String

Dim oMenuItem As MenuItem

' Create the submenu item.

Dim oSubMenuItem As MenuItem

' Add the submenu item to the ChildItems

' collection of the root menu item.

 

 

Try

oMenuItem = Nothing

sRights = Session("Rights")

oConn = New SqlConnection(sConn)

oConn.Open()

sqlCmd = New SqlCommand("INT_Select_Menu", oConn)

sqlCmd.CommandType = CommandType.StoredProcedure

sqlCmd.Parameters.AddWithValue("@Rights", sRights).Direction = ParameterDirection.Input

sdrData = sqlCmd.ExecuteReader

sLogin = Page.Session("Username")

Mymenu.Items.Clear()

While sdrData.Read

 

'AddSubItems(objDataTable, objMenuItem);

If imnuid <> sdrData("mnuID") And oMenuItem IsNot Nothing Then

Mymenu.Items.Add(oMenuItem)

oMenuItem = New MenuItem

Else

If oMenuItem Is Nothing Then

oMenuItem = New MenuItem

End If

End If

imnuid = sdrData("mnuID")

If sdrData("Menu") <> "Aanmelden" Or sLogin = Nothing Then

If sdrData("Menu") Is DBNull.Value Then

sMenu = ""

Else

oMenuItem.Text = sdrData("Menu")

End If

If sdrData("Page") Is DBNull.Value Then

sPage = ""

Else

oMenuItem.Value = imnuid

sPage = sdrData("Page")

oMenuItem.NavigateUrl = sPage

End If

oSubMenuItem = New MenuItem

If sdrData("Submenuid") Is DBNull.Value Then

iSubMenu = 0

Else

oSubMenuItem.Value = sdrData("Submenuid")

End If

If sdrData("Submenu") Is DBNull.Value Then

sSubMenu = ""

Else

oSubMenuItem.Text = sdrData("Submenu")

End If

' Mymenu.LevelMenuItemStyles

If sdrData("SubmenuPage") Is DBNull.Value Then

'Mymenu.Items.Add(oMenuItem)

' oMenuItem = Nothing

Else

oSubMenuItem.NavigateUrl = sdrData("SubmenuPage")

oMenuItem.ChildItems.Add(oSubMenuItem)

oSubMenuItem = Nothing

End If

If sdrData("Menu") = "Aanmelden" Then

Mymenu.Items.Add(oMenuItem)

End If

Else

oMenuItem = New MenuItem

oMenuItem.Value = 100

oMenuItem.Text = "Gebruiker: " & Page.Session("Username")

Mymenu.Items.Add(oMenuItem)

oMenuItem = Nothing

oMenuItem = New MenuItem

oMenuItem.Value = 90

oMenuItem.Text = "Afmelden"

oMenuItem.NavigateUrl = "Main.aspx?page=Logout"

Mymenu.Items.Add(oMenuItem)

' nav.AddParent(imnuid, "Afmelden", "Main.aspx?page=Logout")

End If

 

 

'sdrData("rechten")

End While

sdrData.Close()

Catch ex As Exception

Session.Add("Error", ex.ToString)

Session.Add("TargetPage", "menu.ascx")

Finally

oConn = Nothing

sqlCmd = Nothing

End Try

End Function

 

All help is welcom spam is not

"Troy_Dot_Net"
NewsGroup User
Re: Menu style problem2/13/2006 10:10:21 PM

0

I wish I could help you.  I'm having similar problems with colors for static items.  I'm trying to get my headers (the non links) to be boldface and the links (URL destinations) underlined but everything reverts to the same property.  I've also tried to get rid of new links showing as blue (the client wants all links to be white text) with no luck.

My current menu control declaration:

<asp:Menu ID="Menu1" runat="server" BackColor="#B5C7DE" DataSourceID="SiteMapDataSource1"

DynamicHorizontalOffset="2" DynamicVerticalOffset="1" Font-Names="Arial" Font-Size="small"

ForeColor="White" StaticDisplayLevels="3" StaticSubMenuIndent="10px" Width="120px">

<StaticMenuItemStyle HorizontalPadding="2px" VerticalPadding="2px" BackColor="#005A00"

Font-Bold="False" ForeColor="White" />

<StaticSelectedStyle BackColor="#005a00" ForeColor="White" />

<StaticHoverStyle BackColor="#005a00" ForeColor="Yellow" />

<StaticMenuStyle BackColor="#005a00" ForeColor="white" Font-Bold="true" />

<DynamicMenuStyle BackColor="#005a00" ForeColor="White" />

<DynamicMenuItemStyle BackColor="#005a00" ForeColor="White" />

</asp:Menu>

 

"Troy_Dot_Net"
NewsGroup User
Re: Menu style problem2/14/2006 1:19:10 PM

0

I believe the answer lies in using css styles; this is working for me.  A portion of my css stylesheet is below:

 

.MenuLink A

{

background-color:#005a00;

font-family:Arial;

font-size:small;

color:White;

font-weight:bold;

}

.MenuLink A:active

{

background-color:#005a00;

font-family:Arial;

font-size:small;

color:White;

font-weight:normal;

}

.MenuLink A:link

{

background-color:#005a00;

font-family:Arial;

font-size:small;

color:White;

font-weight:normal;

}

.MenuLink A:visited

{

background-color:#005a00;

font-family:Arial;

font-size:small;

color:White;

font-weight:normal;

}

.MenuLink A:hover

{

background-color:#005a00;

font-family:Arial;

font-size:small;

color:Yellow;

font-weight:normal;

}

The aspx source is below:

<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1"

DynamicHorizontalOffset="2" DynamicVerticalOffset="1"

BackColor="#005a00" ForeColor="White"

StaticDisplayLevels="3" StaticSubMenuIndent="10px" Width="120px"

CssClass="menuLink">

<StaticMenuItemStyle HorizontalPadding="2px" VerticalPadding="2px"

CssClass="MenuLink" />

<StaticSelectedStyle CssClass="MenuLink" />

<StaticHoverStyle CssClass="MenuLink" />

<StaticMenuStyle CssClass="MenuLink" />

</asp:Menu>

I am still trying to tweak the settings to get the look and feel I desire.  It's ashame we have to jump through hoops on what should be simple property settings.

 

3 Items, 1 Pages 1 |< << Go >> >|


Free Download:













adjust the content place holders

themes don't show correctly in designer

treeview - displaying empty node

treeview and pagestate

how to set correct path when content page using

master pages and components in beta 2

databinding and refreshing treeview asp.net 2.0

horizontal menu control + css

how to set the menu display on top of the iframe ?

date and time

treeview - style is generated as inline css

select an item from a menu at runtime?

redirect from frameset to single page

multiple row menu

error on master page

master pages, generating unique control names

2 level static horizontal menu w/ menu control

problem with masterpage

transfering user control to masterpage

inconsistent use of sitemap?

css rule isn't recognized in my theme folder

masterpages

newbie - how to convert existing html page into a master page?

master pages vs iframes

open url in new window

rounded corners

adding "onclientclick" to treeview node...

preserve the selection from a treeview

themes and caching

scroll content of master page such as <frame>

how to use map property in image control inasp.net 2.0

multiple inheritence??

masterpage - declaratively access to a control in a content from another content

how to create navigation bars

asp.net 2.0 master page cannot implement an interface from separate assembly

menu control display problem

trouble with getting a themeless page

creating sitemap xml from directly from database

using javascript in master pages and content pages

layout of www.asp.net page

asp.net menu control display issues

how to disable links in sitemappath?

where to put my javascript function? content page or master page?

horizontal menu

master page and existed web page

changing menu control images dynamically

qualifying masterpage in desinger file

multiple masterpages in one aspx file with ability to have diffrent contentplaceholders

icallbackeventhandler doesn't work in masterpages

asp.net themes skin

   
  Privacy | Contact Us
All Times Are GMT