Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Adding attribute to tag when rendered

Adding attribute to tag when rendered

Scheduled Pinned Locked Moved ASP.NET
htmltutorial
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • 2 Offline
    2 Offline
    2hdass
    wrote on last edited by
    #1

    I am wondering how to add a attribute to an ASP control so that the attribute will show up in the HTML when it is rendered

    C 1 Reply Last reply
    0
    • 2 2hdass

      I am wondering how to add a attribute to an ASP control so that the attribute will show up in the HTML when it is rendered

      C Offline
      C Offline
      ChrisKo 0
      wrote on last edited by
      #2

      Control1.Attributes.Add(string key, string value); Pretty simple.

      2 1 Reply Last reply
      0
      • C ChrisKo 0

        Control1.Attributes.Add(string key, string value); Pretty simple.

        2 Offline
        2 Offline
        2hdass
        wrote on last edited by
        #3

        for some reason, i dont see it showing up when it is renedered. I am using this in a control. i did this : Me.Attributes.Add("name", "somename")

        C 1 Reply Last reply
        0
        • 2 2hdass

          for some reason, i dont see it showing up when it is renedered. I am using this in a control. i did this : Me.Attributes.Add("name", "somename")

          C Offline
          C Offline
          ChrisKo 0
          wrote on last edited by
          #4

          Seems like you are using VB.NET since you're using the Me keyword. I'm a C# guy, but I assume Me is a reference to the Page and as far as I know, I don't think that has an attributes collection. Maybe you could provide more information on exactly what you're tryign to do?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups