Background image for a 2.0 treeview Control

Last post 11-30-2006 3:35 PM by pushp_aspnet. 2 replies.

Sort Posts:

  • Background image for a 2.0 treeview Control

    11-30-2006, 9:23 AM
    • Member
      15 point Member
    • johnheg
    • Member since 11-30-2006, 2:21 PM
    • Posts 9

    Hi

    I am looking to set a background image for my ASP.net 2.0 treeview Control. There does not seem to be a property for this so i was hoping someone out there could help me with it.

    Thanks

  • Re: Background image for a 2.0 treeview Control

    11-30-2006, 2:19 PM
    • Contributor
      2,209 point Contributor
    • pushp_aspnet
    • Member since 10-19-2006, 9:27 AM
    • Hyderabad,India
    • Posts 447

    Try putting your tree view in a div and set the background image for the div.

    If the above doesn't help try putting the following inside the head tag of your page:

    ------------------------------------------------------------------------------------

    <style type="text/css">

    .treeBgImg{background-image : url(<yourimageurl>);}

    </style> 

    <script type="text/javascript">

     window.onload = function(){

     document.getElementById("<%=myTreeView.ClientID%>").className = "treeBgImg";

     //specify your treeview id instead of myTreeView

    </script> 

    ---------------------------------------------------------------------------

    Hope this helps. 

    Home Is Where the Wind Blows
    http://pushpontech.blogspot.com
  • Re: Background image for a 2.0 treeview Control

    11-30-2006, 3:35 PM
    Answer
    • Contributor
      2,209 point Contributor
    • pushp_aspnet
    • Member since 10-19-2006, 9:27 AM
    • Hyderabad,India
    • Posts 447

    forgot to mention adding attribute directly as:

    myTreeView.Attributes.Add("class","treeBgImg");

    or may be even as CssClass in aspx 

    Home Is Where the Wind Blows
    http://pushpontech.blogspot.com
Page 1 of 1 (3 items)