B
bob
Hi,
i want to check whether the textbox of the detailsview is not left empty, in
insert mode.
I did this:
Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles
DetailsView1.ItemInserting
Dim h As String
h = e.Values("myfield")
'If h = "" Then
If h Is Nothing Then
e.Cancel = True
Label1.Text = "may not be empty."
End If
End Sub
I tried two ways (with ="" and with is nothing), but in both cases, i always
get the label text and the event is always cancelled, even when i full some
value.
So, what's wrong with this code?
Thanks
Bob
i want to check whether the textbox of the detailsview is not left empty, in
insert mode.
I did this:
Protected Sub DetailsView1_ItemInserting(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DetailsViewInsertEventArgs) Handles
DetailsView1.ItemInserting
Dim h As String
h = e.Values("myfield")
'If h = "" Then
If h Is Nothing Then
e.Cancel = True
Label1.Text = "may not be empty."
End If
End Sub
I tried two ways (with ="" and with is nothing), but in both cases, i always
get the label text and the event is always cancelled, even when i full some
value.
So, what's wrong with this code?
Thanks
Bob