Home > Archive > Visual Basic Syntax > January 2006 > Type 'ListItem' not defined
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Type 'ListItem' not defined
|
|
| alocacoc17 2006-01-29, 11:53 am |
| Anyone familiar with Microsoft's ASP.NET curriculum where it uses web forms like BenefitsVB? default.aspx.vb is the last file that won't compile for me. I get the error Type 'ListItem' is not defined. has anyone experienced this before, i can't figure out where it should be referencing.. The type is bold in the code below. Thanks for your time, Tom.
Public Class _default
Inherits System.Web.UI.Page
Protected WithEvents cmdSubmit As System.Web.UI.WebControls.Button
Protected WithEvents lblSelections As System.Web.UI.WebControls.Label
Protected WithEvents txtDoctor As System.Web.UI.WebControls.TextBox
Protected WithEvents txtLife As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Protected WithEvents Label2 As System.Web.UI.WebControls.Label
Protected WithEvents chkList As System.Web.UI.WebControls.CheckBoxList
Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Dim li As ListItem
For Each li In chkList.Items
If li.Selected Then
lblSelections.Text &= (", " & li.Value)
End If
Next
End Sub
End Class | |
| alocacoc17 2006-01-29, 12:25 pm |
| ListItem is definitely not defined in any other files either.
Find all "listitem", Subfolders, Find Results 1, Current Project: http://localhost/BenefitsVB/BenefitsVB.vbproj, "*.*"
C:\Inetpub\wwwroot\BenefitsVB\default.aspx.vb(55): Dim li As ListItem
Total found: 1 Matching files: 1 Total files searched: 50 | |
| alocacoc17 2006-01-29, 12:29 pm |
| Ignore that last message, I just found it in BenefitsCS also. I'm not sure how .NETs search works I guess. This is really getting to me, thanks for any help again. Tom. | |
| alocacoc17 2006-01-29, 12:37 pm |
| This let it compile:
Dim li As System.Web.UI.WebControls.ListItem
Nothing works in the browser now, but one step at a time I guess. Thanks to anyone who reads this later. | |
| Jeff Johnson [MVP: VB] 2006-01-30, 7:06 pm |
|
"alocacoc17" <alocacoc17.22fa9r@mail.codecomments.com> wrote in message
news:alocacoc17.22fa9r@mail.codecomments.com...
> Anyone familiar with Microsoft's ASP.NET
This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005,
which has dropped .NET from its name) are off-topic here.
Please ask .NET questions in newsgroups with "dotnet" in their names. The
*.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.*
groups on your news server, connect directly to the Microsoft server:
msnews.microsoft.com.
|
|
|
|
|