Hi there,
After step 9, page 121 "Notice how the
VB.NET code underscore is needed to split the code over two lines.
VB.NET requires the underscore if you want to move the Handles keyword to its own line"
Which underscore it's refering to?
ListControls.aspx
Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ListControls.aspx.vb" Inherits="Demos_ListControls" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>C#</asp:ListItem>
<asp:ListItem>Visual Basic</asp:ListItem>
<asp:ListItem>CSS</asp:ListItem>
</asp:DropDownList>
<asp:CheckBoxList ID="CheckBoxList1" runat="server">
<asp:ListItem>C#</asp:ListItem>
<asp:ListItem>Visual Basic</asp:ListItem>
<asp:ListItem>CSS</asp:ListItem>
</asp:CheckBoxList>
</div>
<asp:Button ID="Button1" runat="server" Text="Button" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</form>
</body>
</html>
ListControls.aspx.
vb
Code:
Partial Class Demos_ListControls
Inherits System.Web.UI.Page
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
End Sub
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Label1.Text = "In the DDL you selected " &
DropDownList1.SelectedValue & "<br />"
For Each item As ListItem In CheckBoxList1.Items
If item.Selected = True Then
Label1.Text &= "In the CBL you selected " & item.Value & "<br />"
End If
Next
End Sub
End Class
Help appreciated. Thks.
Cheers,
Mohamad