VB.Net Checkbox values
am 05.12.2007 16:00:35 von LionsDome
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
Re: VB.Net Checkbox values
am 06.12.2007 00:26:46 von MR. Arnold
"LionsDome" wrote in message
news:a19f9b46-b4f6-4b8b-9c34-be1d7438d7ea@d21g2000prf.google groups.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?
Re: VB.Net Checkbox values
am 06.12.2007 17:40:56 von LionsDome
On Dec 5, 6:26 pm, "Mr. Arnold" wrote:
> "LionsDome" wrote in message
>
> news:a19f9b46-b4f6-4b8b-9c34-be1d7438d7ea@d21g2000prf.google groups.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?
Re: VB.Net Checkbox values
am 07.12.2007 02:53:55 von MR. Arnold
"LionsDome" wrote in message
news:e8d0f3cb-b57f-484a-a645-a01c70a3b32f@d61g2000hsa.google groups.com...
> On Dec 5, 6:26 pm, "Mr. Arnold" wrote:
>> "LionsDome" wrote in message
>>
>> news:a19f9b46-b4f6-4b8b-9c34-be1d7438d7ea@d21g2000prf.google groups.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?
Re: VB.Net Checkbox values
am 19.12.2007 17:18:04 von LionsDome
On Dec 17, 5:30 pm, "Mr. Arnold" wrote:
> "LionsDome" wrote 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?
Re: VB.Net Checkbox values
am 20.12.2007 23:31:59 von MR. Arnold
"LionsDome" wrote in message
news:c5b6734e-f165-45c8-8522-e5173a947700@l32g2000hse.google groups.com...
> On Dec 17, 5:30 pm, "Mr. Arnold" wrote:
>> "LionsDome" wrote 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.