本文整理汇总了VB.NET中System.Web.UI.WebControls.ListViewUpdateEventArgs.NewValues属性的典型用法代码示例。如果您正苦于以下问题:VB.NET ListViewUpdateEventArgs.NewValues属性的具体用法?VB.NET ListViewUpdateEventArgs.NewValues怎么用?VB.NET ListViewUpdateEventArgs.NewValues使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。
在下文中一共展示了ListViewUpdateEventArgs.NewValues属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ContactsListView_ItemUpdating
Sub ContactsListView_ItemUpdating(ByVal sender As Object, ByVal e As ListViewUpdateEventArgs)
' Cancel the update operation if any of the fields is empty
' or null.
For Each de As DictionaryEntry In e.NewValues
' Check if the value is null or empty
If de.Value Is Nothing OrElse de.Value.ToString().Trim().Length = 0 Then
Message.Text = "Cannot set a field to an empty value."
e.Cancel = True
End If
Next
' Convert the email address to lowercase.
Dim emailValue As String = e.NewValues("EmailAddress").ToString()
e.NewValues("EmailAddress") = emailValue.ToLower()
End Sub