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. help for enabled property

help for enabled property

Scheduled Pinned Locked Moved ASP.NET
sysadminhelptutorial
2 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.
  • V Offline
    V Offline
    vamsimohan21
    wrote on last edited by
    #1

    There are some set of server controls its property enabled= may be true or false,now in code behind how to find its current state and i am getting the controls id during runtime like this foreach(Control c in form1.Controls) { ............ }

    Thanks In Advance

    E 1 Reply Last reply
    0
    • V vamsimohan21

      There are some set of server controls its property enabled= may be true or false,now in code behind how to find its current state and i am getting the controls id during runtime like this foreach(Control c in form1.Controls) { ............ }

      Thanks In Advance

      E Offline
      E Offline
      ennaj
      wrote on last edited by
      #2

      Hi, You have to cast the control first like foreach (Control c in form1.Controls) { if (c.ID == lnkLink) //where lnkLink is the ID of the control { LinkButton link = (LinkButton)c; //cast control object to whatever control it should be (ie. LinkButton, TextBox, etc.) bool status = c.Enabled; ... } }

      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