checkbox in server control modified or not page.request question

T

ton

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
 
B

bruce barker

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)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top