为什么我用checkboxlist的items[i]的selected属性在选中还不能返回true??

xxh2002 2003-08-19 01:48:01
为什么我用checkboxlist的items[i]的selected属性在选中还不能返回true??
...全文
84 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
seesea125 2003-08-19
  • 打赏
  • 举报
回复
帖代码看看
cyp503 2003-08-19
  • 打赏
  • 举报
回复
请注意把checkboxlist数据绑定

写在

if(!this.Page.IsPostBack)
{}

里面
在线考试系统 Sub submit_click(ByVal sender As Object, ByVal e As EventArgs) Dim grade As Integer '单选 If RadioButtonList1.SelectedIndex = "2" Then grade = grade + 10 Else a.Visible = True Image1.Visible = True End If If RadioButtonList2.SelectedIndex = "2" Then grade = grade + 10 Else b.Visible = True Image2.Visible = True End If If RadioButtonList3.SelectedIndex = "2" Then grade = grade + 10 Else c.Visible = True Image3.Visible = True End If If RadioButtonList4.SelectedIndex = "2" Then grade = grade + 10 Else d.Visible = True Image4.Visible = True End If If RadioButtonList5.SelectedIndex = "2" Then grade = grade + 10 Else f.Visible = True Image5.Visible = True End If '多选 If CheckBoxList1.Items(0).Selected = False And CheckBoxList1.Items(1).Selected = True And CheckBoxList1.Items(2).Selected = True And CheckBoxList1.Items(3).Selected = True Then grade = grade + 10 Else g.Visible = True Image6.Visible = True End If If CheckBoxList2.Items(0).Selected = False And CheckBoxList2.Items(1).Selected = False And CheckBoxList2.Items(2).Selected = True And CheckBoxList2.Items(3).Selected = False And CheckBoxList2.Items(4).Selected = True And CheckBoxList2.Items(5).Selected = True And CheckBoxList2.Items(6).Selected = True Then grade = grade + 10 Else h.Visible = True Image7.Visible = True End If If CheckBoxList3.Items(0).Selected = True And CheckBoxList3.Items(1).Selected = True And CheckBoxList3.Items(2).Selected = True And CheckBoxList3.Items(3).Selected = False Then grade = grade + 10 Else i.Visible = True Image8.Visible = True End If If CheckBoxList4.Items(0).Selected = True And CheckBoxList4.Items(1).Selected = True And CheckBoxList4.Items(2).Selected = False And CheckBoxList4.Items(3).Selected = True And CheckBoxList4.Items(4).Selected = True Then grade = grade + 10 Else j.Visible = True Image9.Visible = True End If If CheckBoxList5.Items(0).Selected = True And CheckBoxList5.Items(1).Selected = True And CheckBoxList5.Items(2).Selected = False And CheckBoxList5.Items(3).Selected = True Then grade = grade + 10 Else k.Visible = True Image10.Visible = True End If Dim objLabel As New Label objLabel.ID = "message" objLabel.Text = "您的得分为:" & grade & "分 !" '动态产生控件的应用样式的改变? 'objLabel.Style = "background-color:#ffffff;border-width:1;border-style:solid" Page.Controls.Add(objLabel) If grade = 100 Then MsgBox("哦啊!您真了不起,得了满分耶!", 1, "恭喜( ^_^ )") End If submit.Enabled = False reset.Enabled = False End Sub Sub reset_click(ByVal sender As Object, ByVal e As EventArgs) End Sub 在线考试 在线考试 一、单选(每小题十分,共50分) 1、 Do you have a preference _____ a particular food?      A.with B.at C.for D.in 正确答案为:C 2、 By now most freshmen have grown so used to university life that they have forgotten all those ______ about the university they originally had. A.concerns B.worry C.dreams D.ambition 正确答案为:C 3、 Many people want to buy it because,____ , the price is reasonable; ____ , it's rather durable.  A.on one side, on the other side B.for one thing, for another C.on the one hand, on the other hand D.in one part, in the other part 正确答案为:C 4、 The proposal ____ we start doing the experiment two days earlier has been agreed upon by all.  A.which B.what C.that D.of which 正确答案为:C 5、 ____ , we may look forward to better weather. A.comes B.has come C.to be coming D.having come 正确答案为:C 二、多选(每小题十分,共50分) 1.中国三大国粹; 瓷器 中国画 京剧 中医 正确答案为:中国画、京剧、中医 2.四大民间传说: 窦娥冤 西厢记 牛郎织女 牡丹亭 梁山伯与祝英台 白蛇传 孟姜女 正确答案为:牛郎织女、梁山伯与祝英台、白蛇传、孟姜女 3. 建安七子中有三曹: 曹操 曹丕 曹植 曹冲 正确答案为:曹操、曹丕、曹植 4.四大大名楼: 湖南岳阳岳阳楼 江西南昌滕王阁 山西永济鹳雀楼 湖北武汉黄鹤楼 云南昆明大观楼 正确答案为:湖南岳阳楼、江西滕王阁、湖北黄鹤楼、昆明大观楼 5.以下是古代名医的是: 扁鹊 张仲景 贾思勰 淳于意 正确答案为:扁鹊、张仲景、淳于意                 

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧