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. How to get HTML controls in code behind

How to get HTML controls in code behind

Scheduled Pinned Locked Moved ASP.NET
htmlsysadminhelptutorialquestion
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.
  • I Offline
    I Offline
    Inderjeet Kaur
    wrote on last edited by
    #1

    Hi I am using two HTML radio buttons <td align="left" style="height:40px;vertical-align:middle " > <input type="radio" id="rdoLeaveExcHoliday" value="1" name="rdoLeaveOption" onclick=" SelectLeaveType(this,'1');" />Leaves-excluding holidays and weekends <input type="radio" id="rdoLeaveIncHoliday" value="2" name="rdoLeaveOption" onclick=" SelectLeaveType(this,'2');" />Leaves-including holidays and weekends </td> I want to make second radio button invisible if my dataset in code behing returns zero. I canot make them runat="server" How to get it? Any help will be appreciated.. Thanks in advance

    Inderjeet Kaur Sr. Software Engg

    D 1 Reply Last reply
    0
    • I Inderjeet Kaur

      Hi I am using two HTML radio buttons <td align="left" style="height:40px;vertical-align:middle " > <input type="radio" id="rdoLeaveExcHoliday" value="1" name="rdoLeaveOption" onclick=" SelectLeaveType(this,'1');" />Leaves-excluding holidays and weekends <input type="radio" id="rdoLeaveIncHoliday" value="2" name="rdoLeaveOption" onclick=" SelectLeaveType(this,'2');" />Leaves-including holidays and weekends </td> I want to make second radio button invisible if my dataset in code behing returns zero. I canot make them runat="server" How to get it? Any help will be appreciated.. Thanks in advance

      Inderjeet Kaur Sr. Software Engg

      D Offline
      D Offline
      deezZ
      wrote on last edited by
      #2

      Hi There are two things you have to do. (1) Edit the HTML code to include the attribute runat="server" in the opening tag of the HTML control. For example for a table it might be: (2) Then you need to include the namespace "System.Web.UI.HtmlControls" in the code behind (e.g. in VB the directive Imports System.Web.UI.HtmlControls). If you are using Visual Studio then you will find that it will become available in auto-complete under the identifier (in the example above) Table1. With that you will be able to program it's behaviour in a very similar manner to web Server controls. Hope that helps! :thumbsup: Deepak Surana

      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