Results 1 to 9 of 9

Thread: [RESOLVED] Add 'class' attribute to html controlat page load

Threaded View

  1. #1

    Thread Starter
    Addicted Member DemonMade's Avatar
    Join Date
    Dec 2003
    Location
    Holt. MI
    Posts
    179

    Resolved [RESOLVED] Add 'class' attribute to html controlat page load

    I have a set of links that exist in the master page. I have a css class i would like to assign to a particular one of them depending on if that is the page you are at during page load. ex: Home will have the current_page_item class if you are at the index page

    This is what I have:

    Code:
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            DirectCast(Me.Master.FindControl("ctl00_homeLi"), HtmlGenericControl).Attributes.Add("class", "'current_page_item'")
        End Sub
    The problem is it does not seem to work. Any Ideas on what I may be doing wrong?
    Last edited by DemonMade; Mar 18th, 2010 at 09:26 AM. Reason: RESOLVED
    No one is perfect, but it doesn’t hurt to try.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width