troubleshooting Question

Details view validation

Avatar of Simon Cripps
Simon CrippsFlag for United Kingdom of Great Britain and Northern Ireland asked on
.NET ProgrammingASP.NET
4 Comments1 Solution403 ViewsLast Modified:
Hi, I am looking to validate a detailsview as I select update.
I will be looking to check for null values, and checking some feild dependant on values on other field.
I have got my start off code attached but did not get far as it did not understand that I was trying to check if the field was blank and also id not recognize that I was trying to cancel the command if this was blank.

Any suggestions or examples you may have, would be most welcome.
Sub CustomerDetailView_ItemCommand(ByVal sender As Object, ByVal e As DetailsViewCommandEventArgs)
        Select Case e.CommandName
            Case "Cancel"
            Case "Update"
                If DetailsView1.DataItem("VCDescription") = "" Then
                    'cancel this command
                    DetailsView1.DataItem("VCDescription") = "dfgdsf"
                End If
            Case "Insert"
            Case Else
        End Select
    End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros