本文整理汇总了VB.NET中System.Web.UI.WebControls.ListItemCollection.FindByValue方法的典型用法代码示例。如果您正苦于以下问题:VB.NET ListItemCollection.FindByValue方法的具体用法?VB.NET ListItemCollection.FindByValue怎么用?VB.NET ListItemCollection.FindByValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。
在下文中一共展示了ListItemCollection.FindByValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: If
Dim myListItem As ListItem = SearchType.SelectedItem
Dim crItem As ListItem
Dim searchText As String = TextBox1.Text
If(myListItem.Value = "Name") Then
If(TextBox1.Text <> "" ) Then
Dim searchSubfirst As String = searchText.Substring(0,1)
Dim searchSubsecond As String = searchText.Substring(1)
searchText = searchSubfirst.ToUpper()+searchSubsecond.ToLower()
' Search by country or region name.
crItem = ItemCollection.FindByText(searchText)
End If
Else
'Search by country or region code.
crItem = ItemCollection.FindByValue(searchText.ToUpper())
End If
Dim str As String = "Search is successful. Match is Found.<br />"
str = str & "The results for search string '" & searchText & "' are:<br />"
str = str & "the country or region code is: " & crItem.Value & "<br />"
str = str & "the country or region name is: " & crItem.Text
' Add the string to the label.
Label1.Text = str