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


Top 5 Contributors of the Month
Easy Web
Imran Ghani
Post New Web Links

StaticMenuItemSelected-cssClass

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net
 

Can you please advise me how can i mark current tab in menu via css class? Its very often used and it seems to me that CSS Friendly Control Adapters can't do it.

I have used this code:

<asp:Menu ID="menu1" runat="server" DataSourceID="SiteMapDataSource1" 
                        Orientation="Horizontal" StaticDisplayLevels="2" 
                        MaximumDynamicDisplayLevels="0" EnableViewState="False" 
                        StaticSelectedStyle-CssClass="aktualni">
                        <DynamicSelectedStyle CssClass="aktualni" />
                        <StaticSelectedStyle CssClass="aktualni"></StaticSelectedStyle>
                    </asp:Menu>

 




View Complete Post


More Related Resource Links

StaticMenuItemSelected-cssClass

  

Can you please advise me how can i mark current tab in menu via css class? Its very often used and it seems to me that CSS Friendly Control Adapters can't do it.

I have used this code:

<asp:Menu ID="menu1" runat="server" DataSourceID="SiteMapDataSource1" 
                        Orientation="Horizontal" StaticDisplayLevels="2" 
                        MaximumDynamicDisplayLevels="0" EnableViewState="False" 
                        StaticSelectedStyle-CssClass="aktualni">
                        <DynamicSelectedStyle CssClass="aktualni" />
                        <StaticSelectedStyle CssClass="aktualni"></StaticSelectedStyle>
                    </asp:Menu>

 


Don't Understand Why I Get: "The class or CssClass value is not defined."

  
I have a user control with this control in it:  <asp:Panel ID="panelTasks" runat="server" CssClass="taskList">In my styles.css file I have this definition:div.taskList{  height:59px;  margin:0 0 0 0;   padding:2px 0 0 0;  border:groove 2px #c2c2c2;  background-image: url(../Images/Gradients/gradientroyalblue.jpg);}I don't understand why I'm getting the warning message I am.  Any ideas?Robert

problem with changing cssclass name using javascript

  
function DoFocus(fld) { fld.className = 'textboxFocus'; } function ChangeToFocus() { document.getElementById('<%=tbComment.ClientID%>').className="textboxFocus"; } button1.Attributes.Add("OnClick", "ChangeToFocus();")//Not working tbComment.Attributes.Add("OnFocus", "DoFocus(this);")//Working I have two methods to change a control's css class (etc. textbox), however, javascript method 'ChangeToFocus' is not working but I do need that function or something could do the samething (I can't use DoFocus(fld) function as it need to pass that control's reference)     Many thanks for your help! Ray

Setting CssClass on every node in TreeView element

  

Hi,

I would like to set a class for every node that exists on my treeview, so I can change its appearance through CSS only. The TreeNode element is rendered as a table with <td> and <tr> tags. Basically I would like to add "class" attribute to those tags. 

So far I wasn't able to do that, because I couldn't find a suitable property on the treenode element. There IS a CssClass property on the whole treeview but that doesn't help me at all. Also I noticed the NodeStyle and SelectedNodeStyle properties on the TreeView element, but that means that I would have to change the appearance programatically, not with CSS.

Anyone got any ideas?


Get CssClass value using Request.Form

  

Hi all,


Is it possible to get the CssClass and SkinID via Request.Form? 

I tried below but failed.

Dim i As Integer
        Dim itemName As String
        Dim itemValue As String

        For i = 0 To HttpContext.Current.Request.Form.Count - 1
            itemName = HttpContext.Current.Request.Form.AllKeys(i)
            'itemValue = HttpContext.Current.Request.Form.GetValues(i)(0)
            itemValue = HttpContext.Current.Request.Form.Get("CssClass")
            MsgBox(itemValue)
        Next




BR,


change gridview itemtemplate cssclass from code-behind

  

I want to pgroammatically change the gridview ItemTemplate properties (mostly CSS Class)

<asp:GridView ID="gvSearchResults" GridLines="None" Width="700px" ShowHeader="False" AutoGenerateColumns="False" DataSourceID="XMLDS" runat="server"><Columns>
<asp:TemplateField>
<ItemStyle CssClass="WHATEVER" />
<ItemTemplate>

So in the gridview rowdatabound event, I want to change the template based on the data for that specific row.

Apart from the data, how can I change the ItemTemplate CSS class for the current row via Code behind?


Using JavaScript class AND cssClass

  

Hi

I'm using some JavaScript that's called by the class function within a hyperlink control:


<asp:HyperLink ID="HyperLink_MenuSubLink_AddNewOfficial" runat="server" class='colorbox_AddNewOfficial' NavigateUrl="~/secure/club-officials/add-new-official.aspx">Add New Official</asp:HyperLink>


Thing is, I also want to apply the styles I've created for this and other links like it using:


CssClass="BackOfficeMenuLink"


But if I add that, the JavaScript stops working.

Any thoughts?

Thanks as always
Richard 




Categories: 
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