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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Disabling textbox based on combo

Disabling textbox based on combo

Scheduled Pinned Locked Moved C#
csharpasp-net
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.
  • K Offline
    K Offline
    kbkarthik
    wrote on last edited by
    #1

    Iam using Asp.net and c# for backend coding. i have to disable a textbox when a comboboxes value is not set at all, i mean ("--select--). when we happen to change that combbox value to some other values other than --select-i want the textbox to be enabled.

    N 1 Reply Last reply
    0
    • K kbkarthik

      Iam using Asp.net and c# for backend coding. i have to disable a textbox when a comboboxes value is not set at all, i mean ("--select--). when we happen to change that combbox value to some other values other than --select-i want the textbox to be enabled.

      N Offline
      N Offline
      Neel07
      wrote on last edited by
      #2

      You can either write an procedure on onchange event of combobox or make autopostback attribute to true for combobox. And in the code behind file check the combobox value if its other then --select-- set textbox enabled if (Convert.ToInt32(cmbModLev.SelectedItem.Value) != 0) txtBox.Enabled =true; else txtBox.Enabled =false; Share knowledge to enhance your learning

      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