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. Locking a control in ASP.Net

Locking a control in ASP.Net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netquestion
5 Posts 3 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.
  • S Offline
    S Offline
    Support123
    wrote on last edited by
    #1

    Hi all... How does one lock a control (so that no info can be changed in lets say a dropdown box)? I want to display the info but not allow data to be changed manually?

    "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

    M Y 2 Replies Last reply
    0
    • S Support123

      Hi all... How does one lock a control (so that no info can be changed in lets say a dropdown box)? I want to display the info but not allow data to be changed manually?

      "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

      M Offline
      M Offline
      Michael Sync
      wrote on last edited by
      #2

      Are you trying to do like locking the control on winform? If yes, this feature doesn't exist in webform. (AFAIK)

      Support123 wrote:

      I want to display the info

      What kind of information you want to display? Example? I'm not so sure what you are trying to do. It is better if you tell us your scenario with the example.

      Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

      S 1 Reply Last reply
      0
      • S Support123

        Hi all... How does one lock a control (so that no info can be changed in lets say a dropdown box)? I want to display the info but not allow data to be changed manually?

        "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

        Y Offline
        Y Offline
        YeHtut
        wrote on last edited by
        #3

        I understand that you want to do display only?? Dropdown box don't have a ready only property. So you canuse Enable property to false;

        1 Reply Last reply
        0
        • M Michael Sync

          Are you trying to do like locking the control on winform? If yes, this feature doesn't exist in webform. (AFAIK)

          Support123 wrote:

          I want to display the info

          What kind of information you want to display? Example? I'm not so sure what you are trying to do. It is better if you tell us your scenario with the example.

          Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

          S Offline
          S Offline
          Support123
          wrote on last edited by
          #4

          i want to make it so that the user cant enter anything but not to Enabled = false the control because it grays it out (i dont want that) I might be wrong (so please correct me if i am wrong i have been working with c# for a while but i have much to learn.) but isn't there a property in C# called Locked? So you could have something like: ControlName.Locked = True am i mistaken when i say that this bit of code locked the control so that no user input was excepted?.... If this is true... Is this property availible in ASP.Net as well?? (might it be that this property is only availible to textboxes???) Thank you in advance.

          "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

          M 1 Reply Last reply
          0
          • S Support123

            i want to make it so that the user cant enter anything but not to Enabled = false the control because it grays it out (i dont want that) I might be wrong (so please correct me if i am wrong i have been working with c# for a while but i have much to learn.) but isn't there a property in C# called Locked? So you could have something like: ControlName.Locked = True am i mistaken when i say that this bit of code locked the control so that no user input was excepted?.... If this is true... Is this property availible in ASP.Net as well?? (might it be that this property is only availible to textboxes???) Thank you in advance.

            "Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison

            M Offline
            M Offline
            Michael Sync
            wrote on last edited by
            #5

            Support123 wrote:

            it grays it out

            I think you can change it to some other colors from CSS

            Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net)

            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