Wow.  I missed the whole point.  My apologies :-)

I planned to put it here (for both buttonClick and textChanged):

.......
        Else
            Me.Gridview.SelectCommand = "QUERY2 GOES HERE"
            Me.Gridview.SelectParameters.Clear()
            Me.Gridview.SelectParameters.Add("FIELD1", Session
("SESSIONV1"))
            Me.Gridview.SelectParameters.Add("FIELD2",
tb_Signon.Text)
            Me.Gridview.DataBind()


        End If

If GridView1.Rows.Count > 0 Then
     Me.Label1.Visible = False
     Else
     Me.Label1.Visible = True
     Me.Label1.Text = "No results match your request."
End If

Me.GridView1.Visible = True




On Jun 9, 2:08 am, Cerebrus <[email protected]> wrote:
> Your prompt response is commendable. But there is still something
> missing.
>
> You have not answered my question - Where does this code fit in:
>
> ---> If GridView1.Rows.Count > 0 Then
> >    Me.Label1.Visible = False
> > Else
> >    Me.Label1.Visible = True
> >    Me.Label1.Text = "No results match your request."
> > End If
>
> > Me.GridView1.Visible = True
>
> ---
>
> The probable cause of the behaviour you see (The button needs to be
> clicked twice) is because you are lacking in understanding of the Page
> lifecycle. Your databinding is occurring too late in the lifecycle so
> that changes are only reflected upon next postback.

Reply via email to