checkbox in server control modified or not page.request question

Discussion in 'ASP .Net' started by ton, Nov 14, 2008.

  1. ton

    ton Guest

    Hi,
    I have a checkbox in a webserver control.

    Al modified fields (textboxes, dropdownlists, and checkboxes) will be
    examnied during a save method. In which I use:
    aa= Page.Request(Replace(ClientID, "_", "$") & "$Check" & i &
    ClientID).ToString
    aa = Page.Request(Replace(ClientID, "_", "$") & "$Text" & i &
    ClientID).ToString
    aa = Page.Request(Replace(ClientID, "_", "$") & "$Combo" & i &
    ClientID).ToString

    in which I use page.request(name of control) to see what is changed

    I recieve an "on" if the checkbox is checked, bt nothing if it is set to
    off. Offcourse I can values by getting the exact field using:
    dbCheck = FindControl("Check" & i & ClientID, 0) and that checking the
    dbCheck.checked value

    but then I would execute an update statement whether it is or is not changed

    please help


    ton
     
    ton, Nov 14, 2008
    #1
    1. Advertising

  2. ton

    bruce barker Guest

    use UniqueID instead of ClientID to look values in the Request. the browser
    will only postback a checkbox or radio button value if they are checked. so
    you can tell its not checked because its not postback collection.

    -- bruce (sqlwork.com)


    "ton" wrote:

    >
    > Hi,
    > I have a checkbox in a webserver control.
    >
    > Al modified fields (textboxes, dropdownlists, and checkboxes) will be
    > examnied during a save method. In which I use:
    > aa= Page.Request(Replace(ClientID, "_", "$") & "$Check" & i &
    > ClientID).ToString
    > aa = Page.Request(Replace(ClientID, "_", "$") & "$Text" & i &
    > ClientID).ToString
    > aa = Page.Request(Replace(ClientID, "_", "$") & "$Combo" & i &
    > ClientID).ToString
    >
    > in which I use page.request(name of control) to see what is changed
    >
    > I recieve an "on" if the checkbox is checked, bt nothing if it is set to
    > off. Offcourse I can values by getting the exact field using:
    > dbCheck = FindControl("Check" & i & ClientID, 0) and that checking the
    > dbCheck.checked value
    >
    > but then I would execute an update statement whether it is or is not changed
    >
    > please help
    >
    >
    > ton
    >
    >
    >
    >
     
    bruce barker, Nov 14, 2008
    #2
    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. Brian Birtle
    Replies:
    2
    Views:
    2,052
    John Saunders
    Oct 16, 2003
  2. Azmarae
    Replies:
    1
    Views:
    545
    Carlos Campos
    Mar 3, 2004
  3. Attila.Iskander
    Replies:
    14
    Views:
    655
    Adrienne Boswell
    Sep 22, 2011
  4. ton

    Custom Server Control can't hold modified status

    ton, Feb 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    115
  5. Imran Aziz

    checkbox value attribute in checkbox control ?

    Imran Aziz, Aug 6, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    230
    Imran Aziz
    Aug 8, 2005
Loading...

Share This Page