user: psw:
| lost password
ASP.NET 3.5 For Dummies :: Forums
Home » Technical questions » Chapter 5: CheckBox and CheckBoxList Controls Messages in this topic - RSS
1/22/2010 4:08:21 PM
Ken Cox
Posts 170
Hi Christian,

I wasn't aware of the Portuguese version until a reader contacted me. It looks like the publisher did a bad job on transcribing the code snippets. You've found some of the typos and there are obviously more.

If you go to this page and enter 68 (as the page number) and click GO, you'll see the correct source code:

http://kencox.ca/sourcecode.aspx

You can also download the complete code for the chapter here:

http://www.kencox.ca/samplecode/195925_CH05_Code.zip

I'm sorry about the mistakes. If I had been given a chance, I'd have checked the manuscript.

Ken
1/15/2010 5:49:03 AM
thered
Posts 1
Hello, Ken

Some errors ocurred in the script of this part in chapter 5.
First, in the following script (in bold):

If Not IsPostBack Then
Dim arrlGames As New ArrayList
arrlGames.Add("Scrabble")
arrlGames.Add("Crosswords")
arrlGames.Add("Wonderwords")
arrlGames.Add("Sudoku")
arrlGames.Sort()
CheckBoxList!.DataSource = arrlGames
CheckBoxList!.DataBind()
End If

I think the correct script is:

If Not IsPostBack Then
Dim arrlGames As New ArrayList
arrlGames.Add("Scrabble")
arrlGames.Add("Crosswords")
arrlGames.Add("Wonderwords")
arrlGames.Add("Sudoku")
arrlGames.Sort()
CheckBoxList1.DataSource = arrlGames
CheckBoxList1.DataBind()
End If

Also, a script error was found in the script of the button.

Dim strSel As String = " "
For Each chbx As ListItem In CheckBoxList1.Items
If chbx.Selected Then
strSel = srtSel & chbx.Text & "<br/>"
End If
Next
Label1.Text = strSel

According to the program, the error is in the 4th line: strSel = srtSel & chbx.Text & "<br/>", concerning about the srtSel. The message in visual basic is that wam not declared.

Could you check, please what is going on?

My book version is the Portuguese Version. The scripts I mentioned are on page 68.

Thanks

Christian
edited by thered on 1/15/2010
pages: 1
|

Home » Technical questions » Chapter 5: CheckBox and CheckBoxList Controls