473,404 Members | 2,195 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,404 software developers and data experts.

VB.Net Checkbox values

Hello,

I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
Thanks.
Anil
Dec 5 '07 #1
10 4392

"LionsDome" <AK***********@gmail.comwrote in message
news:a1**********************************@d21g2000 prf.googlegroups.com...
Hello,

I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
You got View State for the controls enabled? That's one way that old data on
a control can return to the control. How are you repopulating the the
controls on the round trip when the user hit's the Submit button, and the
value for a control has changed?
Dec 5 '07 #2
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message

news:a1**********************************@d21g2000 prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.

You got View State for the controls enabled? That's one way that old data on
a control can return to the control. How are you repopulating the the
controls on the round trip when the user hit's the Submit button, and the
value for a control has changed?
Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?
Dec 6 '07 #3

"LionsDome" <AK***********@gmail.comwrote in message
news:e8**********************************@d61g2000 hsa.googlegroups.com...
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
>"LionsDome" <AKhemchand...@gmail.comwrote in message

news:a1**********************************@d21g200 0prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.

You got View State for the controls enabled? That's one way that old data
on
a control can return to the control. How are you repopulating the the
controls on the round trip when the user hit's the Submit button, and the
value for a control has changed?

Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?
Is the repopulation of the control being done at PostBack from the database,
and you sure data is being saved to the database?

Dec 7 '07 #4
On Dec 6, 8:53 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message

news:e8**********************************@d61g2000 hsa.googlegroups.com...


On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message
>news:a1**********************************@d21g200 0prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
You got View State for the controls enabled? That's one way that old data
on
a control can return to the control. How are you repopulating the the
controls on the round trip when the user hit's the Submit button, and the
value for a control has changed?
Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?

Is the repopulation of the control being done at PostBack from the database,
and you sure data is being saved to the database?- Hide quoted text -

- Show quoted text -
When you load the page the first and lets assume the database table is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated into
the table. Each submit clears out the table for that particular record
id (We have upto 6 different record Id's that user can select from the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

Thanks for taking the time out to help me thru this. I really
appreciate it a lot.

Anil
Dec 10 '07 #5
On Dec 10, 10:10 am, LionsDome <AKhemchand...@gmail.comwrote:
On Dec 6, 8:53 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:


"LionsDome" <AKhemchand...@gmail.comwrote in message
news:e8**********************************@d61g2000 hsa.googlegroups.com...
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
>"LionsDome" <AKhemchand...@gmail.comwrote in message
>>news:a1**********************************@d21g20 00prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can select a
checkbox(s) and hit the submit button to store those values in a SQL
Server table. This works fine with no problem the first time the user
submits. However when user submits a second time while changing some
of the selected boxes the page only re-submits the previosly selected
checkbox values. It's like its storing it somewhere in the cache or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
>You got View State for the controls enabled? That's one way that old data
>on
>a control can return to the control. How are you repopulating the the
>controls on the round trip when the user hit's the Submit button, and the
>value for a control has changed?
Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?
Is the repopulation of the control being done at PostBack from the database,
and you sure data is being saved to the database?- Hide quoted text -
- Show quoted text -

When you load the page the first and lets assume the database table is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated into
the table. Each submit clears out the table for that particular record
id (We have upto 6 different record Id's that user can select from the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

Thanks for taking the time out to help me thru this. I really
appreciate it a lot.

Anil- Hide quoted text -

- Show quoted text -
Mr. Arnold,

Not sure if you read my reply to your previous posting. I was hoping
to get more feedback from you.

When you load the page the first and lets assume the database table
is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated
into
the table. Each submit clears out the table for that particular
record
id (We have upto 6 different record Id's that user can select from
the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also
set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

Thanks for taking the time out to help me thru this. I really
appreciate it a lot.
Anil


Dec 14 '07 #6

"LionsDome" <AK***********@gmail.comwrote in message
news:b3**********************************@d4g2000p rg.googlegroups.com...
On Dec 10, 10:10 am, LionsDome <AKhemchand...@gmail.comwrote:
>On Dec 6, 8:53 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:


"LionsDome" <AKhemchand...@gmail.comwrote in message
>news:e8**********************************@d61g200 0hsa.googlegroups.com...
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message
>>news:a1**********************************@d21g20 00prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can
select a
checkbox(s) and hit the submit button to store those values in a
SQL
Server table. This works fine with no problem the first time the
user
submits. However when user submits a second time while changing
some
of the selected boxes the page only re-submits the previosly
selected
checkbox values. It's like its storing it somewhere in the cache
or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
>You got View State for the controls enabled? That's one way that old
data
on
a control can return to the control. How are you repopulating the
the
controls on the round trip when the user hit's the Submit button,
and the
value for a control has changed?
Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?
Is the repopulation of the control being done at PostBack from the
database,
and you sure data is being saved to the database?- Hide quoted text -
- Show quoted text -

When you load the page the first and lets assume the database table is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated into
the table. Each submit clears out the table for that particular record
id (We have upto 6 different record Id's that user can select from the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

Thanks for taking the time out to help me thru this. I really
appreciate it a lot.

Anil- Hide quoted text -

- Show quoted text -

Mr. Arnold,

Not sure if you read my reply to your previous posting. I was hoping
to get more feedback from you.

When you load the page the first and lets assume the database table
is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated
into
the table. Each submit clears out the table for that particular
record
id (We have upto 6 different record Id's that user can select from
the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also
set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

It seems to me that you have not saved the values to the database. It could
be that you are not trigging the method that saves the values to the
database possibly. Maybe, you need to use a Session object to hold this
information on round trips. Yes, you have to save data and read data from a
database. But does it mean that you must hold state by saving state data to
the database?



Dec 14 '07 #7
On Dec 14, 5:04 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message

news:b3**********************************@d4g2000p rg.googlegroups.com...


On Dec 10, 10:10 am, LionsDome <AKhemchand...@gmail.comwrote:
On Dec 6, 8:53 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message
news:e8**********************************@d61g2000 hsa.googlegroups.com...
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
>"LionsDome" <AKhemchand...@gmail.comwrote in message
>>news:a1**********************************@d21g20 00prf.googlegroups.com...
Hello,
I have a vb.net page which a bunch of checkboxes. A user can
select a
checkbox(s) and hit the submit button to store those values in a
SQL
Server table. This works fine with no problem the first time the
user
submits. However when user submits a second time while changing
some
of the selected boxes the page only re-submits the previosly
selected
checkbox values. It's like its storing it somewhere in the cache
or
something. My page is ready to launch but cannot for this reason
alone. Any ideas as to what is going on here? Any help would be
greatly appreciated.
>You got View State for the controls enabled? That's one way that old
>data
>on
>a control can return to the control. How are you repopulating the
>the
>controls on the round trip when the user hit's the Submit button,
>and the
>value for a control has changed?
Thanks for response. The values are saved to the database and the
values based on the selected checkboxes get repopulated when the page
is loaded. I set the ViewState for all the checkboxes on the pages to
false and the Page.ViewState to false on page load and I am still
unable to get it to work. Am I missing something here?
Is the repopulation of the control being done at PostBack from the
database,
and you sure data is being saved to the database?- Hide quoted text -
- Show quoted text -
When you load the page the first and lets assume the database table is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated into
the table. Each submit clears out the table for that particular record
id (We have upto 6 different record Id's that user can select from the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.
Thanks for taking the time out to help me thru this. I really
appreciate it a lot.
Anil- Hide quoted text -
- Show quoted text -
Mr. Arnold,
Not sure if you read my reply to your previous posting. I was hoping
to get more feedback from you.
When you load the page the first and lets assume the database table
is
empty with no records in there. You can select a few checkboxes and
hit the submit button and the values get saved and the page is then
reloaded. When you hit the submit button a second time and select
different checkboxes for soem reason the same checkboxes that were
selected in the first goaround are the only ones that get updated
into
the table. Each submit clears out the table for that particular
record
id (We have upto 6 different record Id's that user can select from
the
dropdown) so I know for a fact that the same ones are getting
populated over and over again. Based on your suggestion, I set the
Viewstate property to false for each checkbox on the page and also
set
the page viewstate property to false. I hope I was a little clear in
helping you to understand my problem.

It seems to me that you have not saved the values to the database. It could
be that you are not trigging the method that saves the values to the
database possibly. Maybe, you need to use a Session object to hold this
information on round trips. Yes, you have to save data and read data from a
database. But does it mean that you must hold state by saving state data to
the database?- Hide quoted text -

- Show quoted text -
Mr. Arnold,

Thanks for the response. On the first go around when the table is
empty, the data is saved. I have verified that already. The second
time a user makes a change to the page, I am deleting the existing
recordset and save the data again with the new changes. It is in the
second go around that the changes are not being saved and the original
values selected in the first go around is onyl getting saved
repeatedly. It is here that I was seeking your guidance in trying to
determine why the changes are not getting saved.

Anil
Dec 17 '07 #8

"LionsDome" <AK***********@gmail.comwrote in message
news:71f0f9ac-3286-412e-b59a->- Show quoted >
Mr. Arnold,

Thanks for the response. On the first go around when the table is
empty, the data is saved. I have verified that already. The second
time a user makes a change to the page, I am deleting the existing
recordset and save the data again with the new changes. It is in the
second go around that the changes are not being saved and the original
values selected in the first go around is onyl getting saved
repeatedly. It is here that I was seeking your guidance in trying to
determine why the changes are not getting saved.
What do you mean you have deleted the existing recordset? Either you
selected the record, you got its record-id, and you did a delete by
record-id to delete the record.

I'll assume that you have a try/catch in this routine, and in fact, you know
that the record has been deleted, the routine is not blowing-up and is
leaving the existing record that you keep accessing each time, because the
application blew and you don't know about it.

Dec 17 '07 #9
On Dec 17, 5:30 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
"LionsDome" <AKhemchand...@gmail.comwrote in message

news:71f0f9ac-3286-412e-b59a->- Show quoted >
Mr. Arnold,
Thanks for the response. On the first go around when the table is
empty, the data is saved. I have verified that already. The second
time a user makes a change to the page, I am deleting the existing
recordset and save the data again with the new changes. It is in the
second go around that the changes are not being saved and the original
values selected in the first go around is onyl getting saved
repeatedly. It is here that I was seeking your guidance in trying to
determine why the changes are not getting saved.

What do you mean you have deleted the existing recordset? Either you
selected the record, you got its record-id, and you did a delete by
record-id to delete the record.

I'll assume that you have a try/catch in this routine, and in fact, you know
that the record has been deleted, the routine is not blowing-up and is
leaving the existing record that you keep accessing each time, because the
application blew and you don't know about it.
Well the page has a dropdown and each dropdown has checkboxes. Each
item in the dropdown has an id associated with it. On the first go
around the id does not exist in the table and if it does exist I have
something in place that deletes all values based on that id. I have
checked this in debug mode and it is working fine. Once the Id has
been deleted, it then reinserts the values in the table. But on the
second go around it inserts the same values it did in the first
goaround regardless of what other checkboxes you might hve checked or
unchecked.

For a fact I know its not blowing up. So there must be something else
in the routine or session that just retains the values selected in the
first goaround. Maybe this is only happening with checkboxes?
Dec 19 '07 #10

"LionsDome" <AK***********@gmail.comwrote in message
news:c5**********************************@l32g2000 hse.googlegroups.com...
On Dec 17, 5:30 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:
>"LionsDome" <AKhemchand...@gmail.comwrote in message

news:71f0f9ac-3286-412e-b59a->- Show quoted >
Mr. Arnold,

For a fact I know its not blowing up. So there must be something else
in the routine or session that just retains the values selected in the
first goaround. Maybe this is only happening with checkboxes?

When and how are you saving the values to the table? Is this being done at
Page_Unload? Are you saving the values in variables, before saving the data
to the table? I'll assume something is happening on the Control's
Change_Event.

How are you retrieving the values and trying to populate the form, which
I'll assume this is being done at Page_Load on the Post_Back.

Now, if you have disabled View_State on the controls, then there should be
no way those controls are being populated, unless you're populating the
controls on the Page_Load event during the PostBack.
Dec 20 '07 #11

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

Similar topics

6
by: Angelos | last post by:
I have this list of logs stored in a MySQL DB. I display them in a list and next to each log I have a del view LINK I want to add Checkboxes next to each log and keep del and view links as...
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...
4
by: Vanessa | last post by:
I have an ASP script which is used to upload files with Persits.Upload.1 object. But I can't get the values from mutliple checkboxes in the form like normally. <form method="post"...
1
by: J Talbot | last post by:
Hi Was wondering if anyone could help me with this problem : If I have three checkboxes with different values on a form like : <input type="checkbox" name="checkbox" value="1stValue">...
6
by: Chuck Anderson | last post by:
My knowledge of JavaScript is limited. I learn from example and then adapt those examples to suit my needs. I have stumped myself on this one. I have a form with checkboxes that I want to...
29
by: Amer Neely | last post by:
I've got a dynamically built form with checkboxes for each element ( a list of file names in a directory). I need to grab only those checkboxes that are checked, so I can then delete those files. ...
4
by: Matt | last post by:
I am no JavaScript guru so please bear with me and be as detailed as possible with your response. I thank you in advance. I have an ASP page that contains form elements. I also have an inline...
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...
9
by: raamay | last post by:
I have six checkboxes as shown below: <table> <tr> <td><input name="spec1" type="checkbox" value="0" tabindex="11" /><label id="label">Bridge Construction</label></td> </tr> <tr> <td><input...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.