The error is perfectly clear - you have declared a variable of type
ListViewDataItem
, and you're trying to store a
List(Of ListViewDataItem)
in it.
You're then trying to add the collection of items to itself, which makes absolutely no sense.
You're then assigning a query-string parameter to the first item in an unknown collection called
Items
, which you haven't shown.
Based on your rather brief description of what you're trying to achieve, you want something like this:
Protected Sub ListView2_ItemCreated(ByVal sender As Object, ByVal e As ListViewItemEventArgs) Handles ListView2.ItemCreated
If e.Item.ItemType = ListViewItemType.InsertItem Then
Dim txt As TextBox = TryCast(e.Item.FindControl("SomeTextBox", TextBox))
If txt IsNot Nothing Then
txt.Text = Request.QueryString("pstr")
End If
End If
End Sub