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. General Programming
  3. C#
  4. Disabling controls

Disabling controls

Scheduled Pinned Locked Moved C#
questioncsharpjavascriptsysadmin
3 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.
  • B Offline
    B Offline
    Brendan Vogt
    wrote on last edited by
    #1

    Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005

    X D 2 Replies Last reply
    0
    • B Brendan Vogt

      Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005

      X Offline
      X Offline
      XRaheemX
      wrote on last edited by
      #2

      Unfortunately for right now, if you're wanting to do real time text checks on the web page then some type of Client side script (such as Javascript) is your only option. The only way for the server to manage this is for the page to postback to the server every time the user presses a key in the textbox, which would keep them from typing more than say.. 3 words per minute.

      1 Reply Last reply
      0
      • B Brendan Vogt

        Hi guys, I want to ask a question about diabling a control. I have to select boxes, regions and areas. And a text box that represents a unique ID. Now I only want the user to search either by location, or by unique ID. So if the user selects a region, all the areas for that regions are loaded in the area select control. Then, in the same process, it should make the textbox ReadOnly (so that no data can be entered), which works fine. But my problems comes is, if the user starts to type in a unique ID, then it should disable the 2 select boxes. If the textbox is cleared, then the 2 select boxes are enabled again. I'm not sure if there is an event that checks for this? I think there is an event for the textbox something like text changed, but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server. Is my only option for this via Javascript? Or can I do this on the server? I'm using C#. Regards. -- modified at 3:23 Thursday 13th October, 2005

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        ma se wrote:

        but this doesn't work when I start typing in text, probably because it doesn't make a trip to the server.

        That's exactly why. ASP.NET is a server-side only technology designed to generate HTML for browsers. It's can't interact with the client in real-time.

        ma se wrote:

        Is my only option for this via Javascript?

        Yep. JavaScript is your only option if you want cross-browser compatibility. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        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