VB.Net复选框值 [英] VB.Net Checkbox values

查看:116
本文介绍了VB.Net复选框值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我有一个vb.net页面,其中包含一堆复选框。用户可以选择一个

复选框,然后点击提交按钮将这些值存储在SQL

Server表中。这个工作正常,用户第一次提交
时没问题。但是,当用户在更改所选框的某些

时再次提交页面时,该页面仅重新提交预先选择的

复选框值。它就像把它存放在缓存中的某个地方或

。我的页面已准备好启动但不能因此而单独使用
。关于这里发生了什么的任何想法?任何帮助都会很高兴。

谢谢。

Anil

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

推荐答案



" LionsDome" < AK *********** @ gmail.com写信息

新闻:a1 ******************* *************** @ d21g2000 prf.googlegroups.com ...

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

你好,


我有一个vb.net页面,其中包含一堆复选框。用户可以选择一个

复选框,然后点击提交按钮将这些值存储在SQL

Server表中。这个工作正常,用户第一次提交
时没问题。但是,当用户在更改所选框的某些

时再次提交页面时,该页面仅重新提交预先选择的

复选框值。它就像把它存放在缓存中的某个地方或

。我的页面已准备好启动但不能因此而单独使用
。关于这里发生了什么的任何想法?任何帮助都将非常感谢


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.



您启用了控件的View State吗?这是控件上的旧数据可以返回控件的一种方式。当用户点击提交按钮,并且控件的

值发生了变化时,您如何重新填充往返的

控件?

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?


12月5日下午6:26,Mr。阿诺德" < MR。 Arn ... @ Arnold.comwrote:
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:

" LionsDome" < AKhemchand ... @ gmail.com写信息


新闻:a1 *********************** *********** @ d21g2000 prf.googlegroups.com ...
"LionsDome" <AKhemchand...@gmail.comwrote in message

news:a1**********************************@d21g2000 prf.googlegroups.com...

Hello,
Hello,


我有一个vb.net页面,其中包含一堆复选框。用户可以选择一个

复选框,然后点击提交按钮将这些值存储在SQL

Server表中。这个工作正常,用户第一次提交
时没问题。但是,当用户在更改所选框的某些

时再次提交页面时,该页面仅重新提交预先选择的

复选框值。它就像把它存放在缓存中的某个地方或

。我的页面已准备好启动但不能因此而单独使用
。关于这里发生了什么的任何想法?任何帮助将是

非常感谢。
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.



您启用了控件的View State吗?这是控件上的旧数据可以返回控件的一种方式。当用户点击提交按钮,并且控件的

值已经改变时,你如何重新填充往返的

控件?


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?



感谢您的回复。这些值将保存到数据库中,并且当加载页面

时,将根据所选复选框重新填充

值。我将页面上所有复选框的ViewState设置为

false,并且页面加载时Page.ViewState设置为false,我仍然无法让它工作。我在这里遗漏了什么吗?

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?




" LionsDome" < AK *********** @ gmail.com写信息

新闻:e8 ******************* *************** @ d61g2000 hsa.googlegroups.com ...

"LionsDome" <AK***********@gmail.comwrote in message
news:e8**********************************@d61g2000 hsa.googlegroups.com...

12月5日下午6:26, "先生。阿诺德" < MR。 Arn ... @ Arnold.comwrote:
On Dec 5, 6:26 pm, "Mr. Arnold" <MR. Arn...@Arnold.comwrote:

>" LionsDome" < AKhemchand ... @ gmail.com写信息

新闻:a1 *************************** ******* @ d21g200 0prf.googlegroups.com ...
>"LionsDome" <AKhemchand...@gmail.comwrote in message

news:a1**********************************@d21g200 0prf.googlegroups.com...

Hello,
Hello,


我有一个vb.net页面,其中包含一堆复选框。用户可以选择一个

复选框,然后点击提交按钮将这些值存储在SQL

Server表中。这个工作正常,用户第一次提交
时没问题。但是,当用户在更改所选框的某些

时再次提交页面时,该页面仅重新提交预先选择的

复选框值。它就像把它存放在缓存中的某个地方或

。我的页面已准备好启动但不能因此而单独使用
。关于这里发生了什么的任何想法?任何帮助将是

非常感谢。
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.


您启用了控件的View State吗?这是控件上的旧数据可以返回控件的一种方式。当用户点击提交按钮,并且控件的
值发生变化时,您如何重新填充往返的
控件?


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?



感谢您的回复。这些值将保存到数据库中,并且当加载页面

时,将根据所选复选框重新填充

值。我将页面上所有复选框的ViewState设置为

false,并且页面加载时Page.ViewState设置为false,我仍然无法让它工作。我在这里错过了什么吗?


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?



控件的重新填充是从数据库中的PostBack完成的,

并且您确定数据正在保存到数据库中吗? br />

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


这篇关于VB.Net复选框值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆