473,382 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

checkbox in server control modified or not page.request question

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

Nov 14 '08 #1
2 2133
This is expected. When a checkbox is unchecked , checkbox values are not
sent to the server...

You may want to post about the source problem as it doesn't seem switching
from the usual ASP.NET programming model to manually using Request.Form
would solve the problem you seems to have (you want to know if the user
updated at least one of those 3 fields I'm not sure how using Request.Form
rather than a Checkbox control would solve this ?)

--
Patrice
"ton" <to*@nospam.nla écrit dans le message de groupe de discussion :
16***************************@cache2.tilbu1.nb.hom e.nl...
>
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
Nov 14 '08 #2
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

Nov 14 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jack | last post by:
Hi, I have a checkbox the value which goes to a database via a asp page that builds the sql string. In the front end asp page, the checkbox code is written as follows: <i><input...
10
by: aualias | last post by:
This seems like such a lame question, but how do you bind to a CheckBox with ASP.NET? With Windows Forms there is a DataBindings collection. I do not see it with the web version of the control,...
3
by: Marc Castrechini | last post by:
I have a page that changes an <ASP:Checkbox value based on a user entered value in a textboxm using client side Javascript. After my submit is fired the value for the chkMyCB.checked does not get...
9
by: Craig Andrews | last post by:
Hello, How do I access HTML CheckBoxs in the codebehind section of an ASP.NET program? In the old Interdev days one would: For i = 1 to Request.Form("CheckBox").Count if...
5
by: Dave | last post by:
Hi all, I'm new to ASP.NET and am working through a few exercises in a book to get up to speed. First, some background: I'm running SQL Server 2000 and have one field as a bit data type...
4
by: Mark | last post by:
I am setting up an asp.net site using the Ektron CMS. Every page in the site uses the same basic template, with the look of the page changing via CSS and an id on the body. The id is shared by all...
4
by: Mike Haberfellner | last post by:
....hi everyone, ....i posted this allready, but my newsreader doesn't display it to me - so i'm sorry if it's posted twice... hi again, sorry for not clearly writing what i really need :) ...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
11
by: =?Utf-8?B?UGFyYWcgR2Fpa3dhZA==?= | last post by:
Hi All, I have a large recordset to be displayed on a ASP 3.0 page. I am using recordset paging for this. For the next and previous link i am passing href as <a href=<Page URl>?page=<%=...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.