.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Change style for aspMenu items

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
I am using a aspMenu that renders the horizontal global navigation with useSimpleRendering="true" so that a list (ul,li) menu implementation is used rather than the table implementation.  My question is - how do I change the style of the UL, LI elements? They have class names such as "root static", "static dynamic children", etc. etc.  I can overwrite the css definition for these styles in my custom css. But what if I want the implementation to use my css element names? I tried with using the "CssClass=classname" and "UseSeparateCss=true" for the <Sharepoint:AspMenu> .... but this doesn't seem to have any influence on the CSS elements for the List. Any suggestions? Thanks in advance, Jake.

View Complete Post

More Related Resource Links

dropdownlist javascript change items


I can't find solution for this problem for very long time:

I have dropdownlists in Gridview. I need to dinamicly change content of dropdown on client with javascript. Ok, I know to do that. But the problem is when I send data to server changes in dropdownlist does not see. On server I have  old items. How can I change items in dropdown on client with javascript and than see that items on sever when postback data?


Is it possible to change the title bar background and the font style on default template?



Is there any way to change the default top link /title bar picture and the fonts of the title without breaking anything in the layout/structure?

I have changed the theme to Obsedian and I would also like to change the picture of the title bar of this theme and also the font/style of the title, top link bar, menus..etc. Is there a way to do this?

Please note: I am using WSS 3.0 and I am not the Administrator of the sharepoint. I am only the site admin of some sites on this sharepoint. I can do some basic customization using SPD.

Basically, what I am trying to do is that I want to set up a sharepoint site, however I want to make it NOT look like a sharepoint site.Well I know this is possible, but for my case it might be just partially possible due to the limitation that I am not the Site collection admin and hence I do not have direct access to the server itself.

What I want is to hide most of the sharepoint links/menus/bars, etc and use my own buttons/hyperlinks etc .. for user to navigate on the sites.

Thanks in advance for your help/advices.



dropdownlist bound to sqldatasource adds items instead of replacing on change



I have a series of dropdownlists on webform in ASP 4.0. The first drop down is filled upon load, and then when a user selects a value from that list, it populates the second dropdown. To accomplish this, I have a SQLdatasource with a parametersource of the first drop-down list control. This works great, except when a user changes their selection from the first drop down. It performs the query, but then adds the list of items to the ones that were already there from the previous selection, instead of replacing it with the new data. Here is the code:

 <asp:DropDownList ID="ddlMajor" runat="server" DataMember="DefaultView" 
      DataSourceID="SqlDataSource1" DataTextField="majortext" 
      DataValueField="majorkey" AppendDataBoundItems="True" AutoPostBack="True">
         <asp:ListItem Value="0">Select Major</asp:ListItem>
<asp:DropDownList ID="ddlReq" runat="server" DataMember="DefaultView" 
      DataSourceID="SqlDataSource2" DataTextField="req" DataValueField="admreqkey" 
            AppendDataBoundItems="True" AutoPostBack="True">
                <asp:ListItem Value="0">Sel

how to change the permissions list items using the workflow?

How to change the permissions list items using the workflow? Or how to instull SPDActivities on sharepoint 2010?

style classes for items in databound BulletedList?

hello,i have a BulletedList control which is bound to a data table. the table contains css class names that i need to apply to each generated list item. i realise that i can do it in an explicit loop over the datasource, but is it possible to achieve this without a loop?thankskonstantin

Change Item order wont work for folder items

Hello. Links lists in Sharepoint 2010 have Change Item Order Action which can order your items. I added new content type based on folder content type to my list. And When I want to order my folder items with Change Item Order action Sharepoint sorts my items randomly. For example with 4 folder items it sorts it right in 3 or 4 times. I can't see any rule in it's behavior sometimes it works sometimes not. For Link list items everything is OK. Anyone have an idea? Thanks.

Change "View Report" button style

Hi,    How can i change the style of button "View Report" ? I want to change the image.     Tks!    

WPF: To change the ListView highlight style, what Targettype we should target?

we want to change all list controls (listBox and listView) highlight style by change its border and background. For ListBox, we target to ListBoxItem. it works great. For ListView, we target to LisViewItem, it does not work. What TargetType we should target to? thx! <Style TargetType="{x:Type ListViewItem}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="HorizontalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="Foreground" Value="Blue" /> <Setter Property="Margin" Value="5,0,5,0" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListViewItem}"> <Border x:Name="Bd" Background="Transparent" CornerRadius="3" SnapsToDevicePixels="true" BorderBrush="{x:Null}"> <ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" SnapsToDevicePixel

Apply Style to checkboxlist Items


Hi ,

How to change colour of CheckBoxList Items Text ?

Ex: chkblstRoleFunc1.Attributes.Add("style", "color:red");

But For above ex, red colour is applied to the Text of all the Items of CheckBoxList. I want it to be applicable for only one Item among all the Items i.e. Red Colour for only one Item and rest all Items in Black Colour(which is the default colour).

Please view the following code that I have Impemented. Is It RIGHT ??
            To change I have to call javascript runtime on CheckBoxList OnLoad event.
Problem is that, below written call to Javascript is not Working.
Please have a look at the below given code :

1) Code Behind :-

if (ds1.Tables[0].Rows.Count != 0)

for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
chkblstRoleFunc1.Items.Insert(i, new ListItem(ds1.Tables[0].Rows[i].ItemArray[3].ToString(), ds1.Tables[0].Rows[i].ItemArray[1].ToString()));

if (Convert.ToInt32(ds1.Tables[0].Rows[i].ItemArray[2]) == 0)
chkblstRoleFunc1.Attributes.Add("onload", "javascript:setCheckboxColor('" + ds1.Ta

Change ReportViewer Style



Plz can you tell me how to change the reportViewer style, for example how can i change the color of the button 'Show Report' or the viewer background.Thanks



Change Document Library default action on Items



I have a standard Document Library where I uploaded various  kinds of file (.pdf, swf). Whenever I click on an item (or I paste its direct link into the browser) it prompts me to download it instead of opening it into the browser directly (with flash player or acrobrat in my example).

How to obtain the desired behavior? Thanks

How to change CSS style for unordered list item in master page using VB


When a user logs in to the site, I'm trying to change the color (to "white" -- but only when there is a logged in user) of a list item that is contained on my master page. It is not working. Below is the markup and error message. What am I doing wrong? Thank you.

<script runat="server" language="vbscript">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        Dim currentUser As MembershipUser = Membership.GetUser()

        If currentUser IsNot Nothing Then
            acme.Style("color") = "white"

        End If

    End Sub
    Protected advertise As System.Web.UI.HtmlControls.HtmlGenericControl


On same master page:

<div id="menu">

<ul> <li id="acme"><a href=".

Change the content type for multiple list items


I have a document library which is configured to manage content types.  Users will be expected to upload multiple documents into the library.  Then they will be expected to choose the content type of the file and fill in the required metadata.  The only difference in these content types is the template which will be used to create new files of the specific content type so the columns are identical for each content type.

I have created a public view with inline editing enabled but Content Type is not an editable field.

The problem I have is that when I enable Inline editing, the users don't have an opportunity to select the content type, even though the files have just been uploaded and have not been checked in.

My question is this; how can users change the content type of multiple items without having to go through the complete New Item form? 

With literally thousaands of documents to be imported, having the users fill out a separate form for each document when many will have the same column values is a show stopper for our rollout.  It will take too much time.  The project will be a failure. 

I've also tried to create a datagrid view but the same problem exists.  Content type is not an editable column value.

Thanks for helping.


treeview selected node font style does not change


Hi All,

I have a treeview and I am giving the node style in code behind.

Treeview design is as below:

<asp:TreeView ID="tvIARHierarchies" runat="server" NodeIndent="15" ShowExpandCollapse="true"
                                        ShowLines="True" Width="98%" OnSelectedNodeChanged="tvIARHierarchies_SelectedNodeChanged">
                                        <ParentNodeStyle Font-Bold="False" />
                                        <HoverNodeStyle Font-Underline="True" ForeColor="#6666AA" />

Change TabPanel HeaderTemplate style


The header text in the tab panel is too small and I wanted to make it bigger.  So I included a <span> within the <HeaderTemplate> tags and though the text is larger according to the style of the span it doesn't display properly because the height of the tab (not the panel but just the tab part that sticks above the panel) doesn't become any bigger and I don't see where I can modify this.

Can this be modified and if so how?



How to change style for a control contained in a ControlTemplate


How to change style for a control contained in a ControlTemplate


I have defined a ControlTemplate as shown below (pretty much just a combobox kind of control).

I hoped that I would be able to change the control template for the dropdown button where used on the form by overwriting the DropDownButtonStyle like this, but it doesn’t work.


How can I overwrite the style for a control contained in a control template? (other than exposing the control as a property on the custom control)


UserControl.Resources – this should give me the brown button style

<Style x:Key="DropDownButtonStyle

How to change image\parameters on style definition ?


I define some new button style.
The style default background is image X.bmp and when on 'mouseOver' is true the image is changing to Y.bmp

I have 10 buttons on the code that need to use this style - and each of the button need to show different image as default different image on 'mouseOver' event.

I can set the bitmap on each button on the button constructor - but i don't know how to set the image in this case on the style definition level.

Someone can help here ?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend