I have a stupid question I was hoping someone would help with. I'm tired and just can't think anymore.
I have an website with three drop down lists that are attached to an Access Database.
I have a gridview that holds an SQL Statement to query the database based on the DDL controls.
SO if you select location as Florida in the drop down, the statement reads: "SELECT * FROM table WHERE location = Florida"
If you hit a button, the page refreshes, the SQL Statement Runs and a gridview of the query results is displayed.
Here's my question.
When that GridView displays I have a hidden label called "lblStatusSearch" that I want to remain blank (and therefore hidden).
BUT when the gridview DOES NOT display (ie the SQL query yields no results I want that label to say "Try Again"
I know the VB code for the label, I'm not quite THAT new (lblStatusSearch.Text = "try again")
I just don't know where to put the IF statement to cause it to appear!
Here's what I got. Let me know if you need more. Thanks
Partial Public Class frmClient
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Protected Sub btnReset_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnReset.Click
Protected Sub btnSearch_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSearch.Click
Protected Sub gvResults_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles gvResults.SelectedIndexChanged
If gvResults.Visible Then
lblStatusSearch.Text = ""
lblStatusSearch.Text = "Try Again"
Protected Sub tblUsersGridView_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles tblUsersGridView.Selecting