D
Do
Hi,
Has anybody run into problems with Page.IsValid?
My errors show up when the fields aren't filled correctly, but my
processing continues even if the page is invalid.
I leave name and description blank and I do get the error messages. But
the code still continues to run the addfolder method from my class.
Is there something wrong with this?
Here's the code:
Dim strName As String
Dim strDescription As String
Dim intParent As Integer
strName = txtName.Text
strDescription = txtDescription.Text
intParent = lstParents.SelectedValue
Response.Write(strName)
Response.Write(strDescription)
Response.Write(intParent)
If Page.IsValid Then
Try
Dim objFolder As New folder
If CBool(objFolder.addfolder(strName, strDescription, intParent)) Then
Response.Write("Inserted new folder")
Else
Response.Write("Problem with folder insertion")
End If
objFolder = Nothing
Catch ex As Exception
Response.Write(ex.Message)
End Try
End If
Has anybody run into problems with Page.IsValid?
My errors show up when the fields aren't filled correctly, but my
processing continues even if the page is invalid.
I leave name and description blank and I do get the error messages. But
the code still continues to run the addfolder method from my class.
Is there something wrong with this?
Here's the code:
Dim strName As String
Dim strDescription As String
Dim intParent As Integer
strName = txtName.Text
strDescription = txtDescription.Text
intParent = lstParents.SelectedValue
Response.Write(strName)
Response.Write(strDescription)
Response.Write(intParent)
If Page.IsValid Then
Try
Dim objFolder As New folder
If CBool(objFolder.addfolder(strName, strDescription, intParent)) Then
Response.Write("Inserted new folder")
Else
Response.Write("Problem with folder insertion")
End If
objFolder = Nothing
Catch ex As Exception
Response.Write(ex.Message)
End Try
End If