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. Removing Top attribute for webform controls

Removing Top attribute for webform controls

Scheduled Pinned Locked Moved ASP.NET
questionwinforms
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.
  • U Offline
    U Offline
    User 1804931
    wrote on last edited by
    #1

    Hi, How can I remove the 'Top' attribute of all controls in the form dynamically i.e. I want to do this before render. First I want to check weather the type of control is web control or not, because in my form I have some user controls also. I tried it with using form.controls, but it is giving invalid cast exception. How can I do this? Regards, Chakravarthy.V

    R 1 Reply Last reply
    0
    • U User 1804931

      Hi, How can I remove the 'Top' attribute of all controls in the form dynamically i.e. I want to do this before render. First I want to check weather the type of control is web control or not, because in my form I have some user controls also. I tried it with using form.controls, but it is giving invalid cast exception. How can I do this? Regards, Chakravarthy.V

      R Offline
      R Offline
      Rhys Gravell
      wrote on last edited by
      #2

      If you look at the 'Get All TextBoxes On A Page' thread you should be able to utilise and amend the code in my post there to iterate controls on a page and identify WebControls. Once you've got an instance of a web control you should be able to use the WebControl.Attributes.Remove method to remove attributes from a server control's AttributeCollection object I believe, (not that I've tried it myself). Hope this helps :-) Rhys A bus station is where a bus stops. A train station is where a train stops. On my desk I have a workstation... Vampireware /n/, a project, capable of sucking the lifeblood out of anyone unfortunate enough to be assigned to it, which never actually sees the light of day, but nonetheless refuses to die.

      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