Problem With CheckBoxList, PLEASE HELP!!!
I am having trouble with a checkboxlist.
When the webpage loads, a checkboxlist is displayed along with some other form fields and buttons. Some checkboxes are ticked depending on whether or not there was an entry for them in a database. All of the fields are disabled, including the checkbox list.
There is an update button on the page, when it is pressed, the form fields are enabled. Everything works fine except that the checkboxlist is reset, no checkboxes are ticked anymore. I don't understand why this is so but it is.
Below is the code that is used to view the form fields, cbl_Sections is the name of the checkboxlist:
Sub ViewRecord(str_RecID As string)
Table1.Visible = False
Table2.Visible = True
lblFilter.Visible = False
str_Filter.Visible = False
btnFilter.Visible = False
btnAddNew.Visible = True
btnList.Visible = True
btnUpdate.Visible = True
btnDelete.Visible = True
btnSave.Visible = False
btnCancel.Visible = False
btnAddNew.CommandArgument = "PAGE"
str_ArticleID.ReadOnly = True
str_ArticleTitle.ReadOnly = True
str_Keywords.ReadOnly = True
str_MetaTags.ReadOnly = True
str_PageTitle.ReadOnly = True
str_PageName.ReadOnly = True
str_SpecialText.ReadOnly = True
str_ArticleText.ReadOnly = True
ddl_Special.Enabled = False
ddl_Active.Enabled = False
cbl_Sections.Enabled = False
articleObj.setObject(str_RecID)
str_ArticleID.text = str_RecID
str_ArticleTitle.text = articleObj.getArticleTitle()
str_Keywords.text = articleObj.getKeywords()
str_MetaTags.text = articleObj.getMetaTags()
str_PageTitle.text = articleObj.getPageTitle()
str_PageName.text = articleObj.getPageName()
str_SpecialText.text = articleObj.getSpecialText()
str_ArticleText.text = articleObj.getArticleText()
if articleObj.getIsSpecial()
ddl_Special.SelectedIndex = 0
else
ddl_Special.SelectedIndex = 1
end if
if articleObj.getDisplay()
ddl_Active.SelectedIndex = 0
else
ddl_Active.SelectedIndex = 1
end if
articleObj.CheckSections(cbl_Sections)
End Sub
Next is the code that is executed when the update button is pressed:
Sub btnClick_Update(Sender As Object, E As EventArgs)
if not articleObj.checkInUse(CStr(str_ArticleID.Text))
articleObj.setInUse(CStr(str_ArticleID.Text))
btnAddNew.Visible = False
btnUpdate.Visible = False
btnDelete.Visible = False
btnList.Visible = False
str_ArticleTitle.ReadOnly = False
str_Keywords.ReadOnly = False
str_MetaTags.ReadOnly = False
str_PageTitle.ReadOnly = False
str_PageName.ReadOnly = False
str_SpecialText.ReadOnly = False
str_ArticleText.ReadOnly = False
ddl_Special.Enabled = True
ddl_Active.Enabled = True
cbl_Sections.Enabled = True
btnSave.Visible = True
btnCancel.Visible = True
btnSave.CommandArgument = "UPDATE"
btnCancel.CommandArgument = "UPDATE"
else
Me.ViewRecord(CStr(str_ArticleID.Text))
end if
End Sub
Any help would be greatly appreciated.
Thanks:(:(:(
|