How to do a validation for empty grid view?

Posted by Annagoldtech under VB.NET on 4/25/2013 | Points: 10 | Views : 1420 | Status : [Member] | Replies : 1

I am working on VB.Net Framework 1.1.
I have a page with file upload, button upload and gridview.
When "Upload" button is clicked, i need to show the attachments in grid view.
If file is not attached, i need to show a error message.

In my code behind i wrote this code:
If dgTeam.Items.Count = 0 Then
DisplayPrompt("Please upload attachments")
End If

If ddlEvaluate.SelectedIndex = 0 Then
DisplayPrompt("Please select an evaluator")
End If

My issue is: if i didnt select evaluator and click submit button, the error message of file upload is display properly.
but if i select my evaluator and click submit button, i am not getting error message and my grid view is not validating as per my command.

Can u guys help me to resolve this issue. Either the above code or please suggest me to write validation in javascript.



Posted by: Annagoldtech on: 4/28/2013 [Member] Starter | Points: 25


The above url is for validating dropdown list and list items, but my concern is validating the gridview.

I want to show the error message when file is not attached in the gridview.


Annagoldtech, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response