MVC :: How To Get The Current Menu Tab To Have A Different Color
Feb 5, 2011
I am playing around with MVC 2.0 and have changed a few colors in the Site.css to suit my preferences but can't seem to get normal tab behavior for the menu to work. Most web pages that have tabs have a different color for the current tab, i.e. the current "Forums" tab on this web site is a different color from all the rest. Is there a way to easily hook this up or a hard way?
View 7 Replies
Similar Messages:
Jan 18, 2011
I m using this code
Menu menu = new Menu();
menu.MenuItemClick += new MenuEventHandler(menu_MenuItemClick);
menu.BackColor = System.Drawing.Color.AliceBlue;
But i want that background color of menu should be seprate two Different color red and AliceBlue
View 3 Replies
Jul 15, 2013
i have a asp menu in master page and it is populated from database.
i want if user click a link that menu link's background color should change how to do?
View 1 Replies
May 7, 2015
How to center the menuitems and highlight the selected menuitem in menu control in asp.net?
<asp:Menu ID="maspageMenu" runat="server" BackColor="#2D2D30" Width="100%" DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="1.4em" Font-Strikeout="True" Font-Underline="True" ForeColor="#009933" Orientation="Horizontal" StaticSubMenuIndent="10px" BorderStyle="Groove">
<DynamicHoverStyle BackColor="#18624F" ForeColor="White" />
<DynamicMenuItemStyle BackColor="White" HorizontalPadding="5px" VerticalPadding="2px" />
<DynamicMenuStyle BackColor="White" BorderStyle="Double" />
[CODE]...
View 1 Replies
Aug 19, 2010
I am using master pages standard theme is vs 2010, have few tabs and they all open different pages. wondering if any body knows how to change the colour of tab after the tab is clicked. will be useful to identify page for user.
View 2 Replies
Aug 10, 2010
I have a DropDownList on an ASP.NET page that gets populated by a SQL database.
<asp:DropDownList ID="ddlName" runat="server"></asp:DropDownList>
The population is down in the code behind file:
ddlName.DataSource = SqlDataSource1;
ddlName.DataValueField = (this.ddlName.SelectedValue);
ddlName.DataTextField = "ccName";
ddlName.DataBind();
I was wondering if it was possible to change the background or text color of an item in the list based on it's value? I just noticed that the example below works when the page first loads but on postback the text color disappears even though that is where the code is. Is there something I am missing?
protected override void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
ddlName.DataSource = SqlDataSource5;
ddlName.DataValueField = (this.ddlName.SelectedValue);
ddlName.DataTextField = "ccName";
ddlName.DataBind();
foreach (ListItem item in ddlName.Items)
{
if (item.Value == "Item 1")
{
item.Attributes.Add("style", "color:red");
}
if (item.Value == "Item 2")
{
item.Attributes.Add("style", "color:red");
}
}
}
}
View 1 Replies
Jun 3, 2012
I am working on a web page that handles alerts from National Weather Service. What I am wanting to do is when i drop a text file for watches and warnings, is to have the watches font color change from black to red and have the submenu also change.
example:watches>Middle Tennessee Watches
I want both of these to turn red if the file middletnwatches.txt exist. I know how to do the
Code:
if file.exists(server.mappath("middletnwatches.txt")) then
but I don't know how to pull the rest of it off.
View 8 Replies
May 13, 2010
I created a new ASP.NET web site project. The project starts with a number of default features and one of them is a menu. The menu has a blue/slate color to it.I want to change the color but can't find where it's defined. I checked the Site.css that is created and cannot find the value that is coloring it.
View 6 Replies
Feb 4, 2011
Iam using a Asp menu control in master page(Which is used by the content pages) . For the Menu control, iam dyanamically binding the items through code. My requirement is when i select any item from the menu control it should change its color. I tried different ways such as using DyanamicSelectedstyle e.tc., but nothing is working. How to change the color of the menu control dyanamically.
View 3 Replies
Jan 7, 2011
I have the following code:
foreach (Color color in new ColorConverter().GetStandardValues())
{
output.Write(color.ToString());
}
What would be the syntax to get it to show as a color palette instead of just listing the colors?
View 1 Replies
Apr 14, 2010
I'm not sure what is happening but I cannot get my menu to display any other font color than 'burgundy' even if I specify Black or White. Plus when I Hover over my main menu items, the sub-items have a background of white and appear empty... I know strange! To test my page I copied some code from a tutorial at: [URL] All I changed were the Orientation to horizontal and of course the URLs... and still the problem remains.
<asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6" DynamicHorizontalOffset="2" Orientation="Horizontal"
Font-Names="Verdana" ForeColor="#990000" StaticSubMenuIndent="10px">
<Items>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 0" Value="Book 0"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 1" Value="Book 1">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
</asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="Book 2" Value="Book 2">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 2" Value="Chapter 2">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2"
/>
</asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Book 3" Value="Book 3">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 0" Value="Chapter 0"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 1" Value="Chapter 1">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 2" Value="Chapter 2">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2"
/>
</asp:MenuItem>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Chapter 3" Value="Chapter 3">
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 1" Value="Page 1"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 2" Value="Page 2"
/>
<asp:MenuItem NavigateUrl="~/StaticMenuItemCollection_cs.aspx" Text="Page 3" Value="Page 3"
/>
</asp:MenuItem>
</asp:MenuItem>
</Items>
<StaticSelectedStyle BackColor="#FFCC66"
/>
<StaticMenuItemStyle HorizontalPadding="5px"/>
<DynamicMenuStyle BackColor="#FFFBD6"
/>
<DynamicSelectedStyle BackColor="#FFCC66"
/>
<DynamicMenuItemStyle HorizontalPadding="5px"/>
<DynamicHoverStyle BackColor="#990000" Font-Bold="False" ForeColor="White"
/>
<StaticHoverStyle BackColor="#990000" Font-Bold="False" ForeColor="White"
/>
</asp:Menu>
View 7 Replies
Apr 21, 2010
When the asp:menu object gets rendered, the parent nodes show up with an arrow head next to them.The arrow head's color is black.How can I change this to some other color?
View 3 Replies
Apr 12, 2010
How to maintain the color of sub selected item in accordian menu
View 1 Replies
Mar 15, 2011
I have Jobschedule( different work centers) displaying in grid view on my webform When particular workcenter passes the current date then it should highlight with Red color ,(following sechedule i bolded the dated which are passed current date since i did not find how to make color here)
View 12 Replies
Jul 28, 2010
visit this website:
[URL]
it is in Persian Language(IRAN).the problem is the menu(blue color) is not showing the contents in some browsers on some computers.?
View 3 Replies
Feb 10, 2011
how to change the background color of a selected menu item? The background color changes on the word of the dropdown menu but not the entire row section of the menu item. Each menu item has a different word length but I want the background
color length to be consistent throughout the dropdown dynamic menu. I also what to change the background parent when a menu item is selected.
View 1 Replies
Aug 10, 2010
I am trying to show the user of my application that when they click on a menu item that their selection gets shown by changing the background color of that menu item
I am using the default menu that comes with asp and is contained in the site master. the default CSS for the menu has a hover and active properties but only the hover works.
View 11 Replies
Jan 15, 2010
Im building a navigation and want to display the current page (Default.aspx, OtherPage.aspx) the user is on with a class.Right now I just have a bunch of links as <a> tags.Here is a my menu:
[Code]....
As you can see the Default.aspx has the class active, but that is just something I put in.How do I do this dynamically?I know I can use Path.GetFileName(Request.FilePath) to get what page the user is on.
View 3 Replies
Feb 16, 2011
I want to highlight asp menu item for current page.
I use template from visual studio 2010
Ex. current page is home.aspx then menu HOME must highlight
[code]...
View 4 Replies
Sep 17, 2010
What would be the standard easiest way to change the css class of the link that is the link for the page that is currently displayed. So that it will reflect on the menu links.
View 3 Replies
Feb 17, 2010
I'v been looking for ages on how to get the current selected menu item into a label. so for example on the menu you have home and about, if i click on about it will but the text "About" in the labels text whats in the body of the form. You could say its a sub heading and i would like to do this in c# ;) somthing like this:
lblHeading.Text = Menu1.Page.Title.ToString();
except this retutns the tabpage title not the actual menu item i selected.
View 1 Replies
Sep 21, 2010
I have a menu in a user control with a sql database datasource. From what I have read online, the staticselectedstyle will only work if the menu control has a datasourceid defined. Here's what I have so far:
<asp:Menu ID="mnuMoESP" runat="server" Orientation="Horizontal"
ForeColor="White" BackColor="Transparent" Height="30px" Font-Bold="True"
Font-Size="Medium" Font-Names="Arial"
StaticMenuItemStyle-ItemSpacing="0" style="text-align:center" >
<StaticSelectedStyle BackColor="White" ForeColor="#402000"/>
<StaticMenuItemStyle BackColor="#5a630c" BorderColor="White"
BorderStyle="Ridge" BorderWidth="3" ItemSpacing="5px"/>
<StaticHoverStyle BackColor="#402000" />
<StaticItemTemplate>
<%# Eval("Text") %>
</StaticItemTemplate>
</asp:Menu>
and code behind:
private void PopulateMenu()
{
mnuMoESP.Orientation = Orientation.Horizontal;
mnuMoESP.Width = Unit.Percentage(100);
DataSet dsmenu = (DataSet)Session["menu"];
DataTable dtmenu;
dtmenu = dsmenu.Tables[0];
foreach (DataRow theRow in dtmenu.Rows)
{
MenuItem categoryItem = new MenuItem((string)theRow["page_menu_parent"]);
mnuMoESP.Items.Add(categoryItem);
categoryItem.NavigateUrl = GetNavUrl(theRow["page_path"], theRow["page_name"]);
}
}
View 1 Replies
Oct 19, 2010
I have a class (let's call it Car) that has a property of type System.Drawing.Color (Call it CarColor). I have a script service function that uses this Car class as a return value, which works just fine. I then have another script service function that takes a Car object as a parameter. I would like to change the color of the car in Javascript, but I am finding it difficult to do so without adding another parameter that takes in the color as a string and is then translated at the server. Are there any ideas on how to set the Color property of the Car object in Javascript and maintain it through to the server?
View 1 Replies
Oct 1, 2010
I want simple jquery color picker for font(text) color selection not specific to particular textbox but to all txt boxes on form and must for font color selection not for background color .Simple color picker should like layout color selection.i want color[URL]
View 3 Replies
Nov 1, 2010
using vb.net/asp.net 2005.
I am trying to set the border color of cells of my datagrid to an HTML color code: #c1c1c1
I have the following and would like to convert it so that it uses my color code and not the text of the color name, does anyone know the syntax? what I have is:
[Code]....
View 3 Replies