"Protect" or Disable Editing of A Webcontrol

Discussion in 'ASP .Net Web Controls' started by Randy, Jan 19, 2006.

  1. Randy

    Randy Guest

    I hope somebody can make a hero out of me before tomorrow! Let's say I
    have a web page with a couple of textboxes, checkboxes, radio buttons,
    etc. User fills in some data, clicks submit, and off it goes. Tomorrow,
    someone else retrieves that page with the data. I want the second user
    to see what looks like the same page, with the data now filled in, but
    with the data fields locked so that they can't be edited. I remember
    the old VB 6 Windows Form controls enable property would enable
    editing. The enable property on a web control, however, has a whole
    'nuther use. I already have a control that allows me to identify the
    specific controls I want to lock (and later unlock under certain
    circumstances), but I have no clue how to actually do the locking.
    Can somebody offer a hint?
    Any thoughts would be greatly appreciated.
    Randy
    Randy, Jan 19, 2006
    #1
    1. Advertising

  2. myTextField.ReadOnly = true;

    ??

    "Randy" <> wrote in message
    news:...
    >I hope somebody can make a hero out of me before tomorrow! Let's say I
    > have a web page with a couple of textboxes, checkboxes, radio buttons,
    > etc. User fills in some data, clicks submit, and off it goes. Tomorrow,
    > someone else retrieves that page with the data. I want the second user
    > to see what looks like the same page, with the data now filled in, but
    > with the data fields locked so that they can't be edited. I remember
    > the old VB 6 Windows Form controls enable property would enable
    > editing. The enable property on a web control, however, has a whole
    > 'nuther use. I already have a control that allows me to identify the
    > specific controls I want to lock (and later unlock under certain
    > circumstances), but I have no clue how to actually do the locking.
    > Can somebody offer a hint?
    > Any thoughts would be greatly appreciated.
    > Randy
    >
    Gabriel Magaña, Jan 19, 2006
    #2
    1. Advertising

  3. Randy

    Randy Guest

    AFIK, there ain't no such method/Property. Wish there were. Or are you
    suggesting something else?
    Thanks.
    Randy
    Randy, Jan 19, 2006
    #3
  4. Randy

    Randy Guest

    Oops. OK, well there's such a thing for a TextBox but I need to do the
    same thing for checkboxes, radiobuttons, even dropdown lists and
    listboxes. I think I can create a style sheet property that makes the
    various controls LOOK like they aren't editable, but I need them to be
    actually protected, read only, what have you.
    Randy, Jan 19, 2006
    #4
  5. Randy

    Doug Salomon Guest

    Try setting "Readonly=True" for text boxes and "Enabled=False" for the other
    controls.

    "Gabriel Magaña" wrote:

    > myTextField.ReadOnly = true;
    >
    > ??
    >
    > "Randy" <> wrote in message
    > news:...
    > >I hope somebody can make a hero out of me before tomorrow! Let's say I
    > > have a web page with a couple of textboxes, checkboxes, radio buttons,
    > > etc. User fills in some data, clicks submit, and off it goes. Tomorrow,
    > > someone else retrieves that page with the data. I want the second user
    > > to see what looks like the same page, with the data now filled in, but
    > > with the data fields locked so that they can't be edited. I remember
    > > the old VB 6 Windows Form controls enable property would enable
    > > editing. The enable property on a web control, however, has a whole
    > > 'nuther use. I already have a control that allows me to identify the
    > > specific controls I want to lock (and later unlock under certain
    > > circumstances), but I have no clue how to actually do the locking.
    > > Can somebody offer a hint?
    > > Any thoughts would be greatly appreciated.
    > > Randy
    > >

    >
    >
    >
    Doug Salomon, Jan 19, 2006
    #5
  6. It'd be a little ugly, but you can use javascript, or you can use a bitmap
    instead of, say, a true checkbox... I've seen it done both ways, and each
    has drawbacks...

    "Randy" <> wrote in message
    news:...
    > Oops. OK, well there's such a thing for a TextBox but I need to do the
    > same thing for checkboxes, radiobuttons, even dropdown lists and
    > listboxes. I think I can create a style sheet property that makes the
    > various controls LOOK like they aren't editable, but I need them to be
    > actually protected, read only, what have you.
    >
    Gabriel Magaña, Jan 19, 2006
    #6
  7. Randy

    Randy Guest

    Do you remember the Strawman from the Wizard of Oz? That's what I feel
    like right now... "If I only had a brain."
    10 minutes ago, I would have swon by anything you like that the Enabled
    property had to do with whether a control's value was recorded in the
    ViewState array. I don't know where I get these crazy ideas.
    Thank you for setting me straight.
    RAndy
    Randy, Jan 19, 2006
    #7
  8. Randy

    Doug Salomon Guest

    My Pleasure.


    "Randy" wrote:

    > Do you remember the Strawman from the Wizard of Oz? That's what I feel
    > like right now... "If I only had a brain."
    > 10 minutes ago, I would have swon by anything you like that the Enabled
    > property had to do with whether a control's value was recorded in the
    > ViewState array. I don't know where I get these crazy ideas.
    > Thank you for setting me straight.
    > RAndy
    >
    >
    Doug Salomon, Jan 19, 2006
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    2
    Views:
    725
  2. Randy
    Replies:
    7
    Views:
    427
    =?Utf-8?B?RG91ZyBTYWxvbW9u?=
    Jan 19, 2006
  3. Replies:
    0
    Views:
    577
  4. ovatta
    Replies:
    4
    Views:
    273
    280Z28
    May 28, 2007
  5. Roberto Carabajal

    Style editing text in Datagrid WebControl

    Roberto Carabajal, Sep 23, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    102
    Roberto Carabajal
    Sep 23, 2004
Loading...

Share This Page