Click here to Skip to main content
16,012,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Protected Sub SearchclerkButton_Click(sender As Object, e As EventArgs) Handles SearchclerkButton.Click
        Dim cmd2 As New SqlCommand
        Dim con2 As New SqlConnection
        con2.ConnectionString = SqlDataSource1.ConnectionString
        con2.Open()
        cmd2.Connection = con2
        cmd2.CommandText = "select coalesce(cleclerkfirstname, '') + ' ' + coalesce(cleclerklastname, '') from cleclerk where cleclerklocation = '" & ClerkDropDownList1.SelectedItem.Text & "'"
        ClerkLabel1.Text = cmd2.ExecuteScalar.ToString()

End Sub

I have a button and on click event.
how do I show the results in a popup. Any help would be great.
Posted

VB
Protected Sub SearchclerkButton_Click(sender As Object, e As EventArgs) Handles SearchclerkButton.Click
        Dim cmd2 As New SqlCommand
        Dim con2 As New SqlConnection
        con2.ConnectionString = SqlDataSource1.ConnectionString
        con2.Open()
        cmd2.Connection = con2
        cmd2.CommandText = "select coalesce(cleclerkfirstname, '') + ' ' + coalesce(cleclerklastname, '') from cleclerk where cleclerklocation = '" & ClerkDropDownList1.SelectedItem.Text & "'"
        ClerkLabel1.Text = cmd2.ExecuteScalar.ToString()

        'Try below code
        Page.ClientScript.RegisterStartupScript(Me.[GetType](), "popupWin", "alert('Your message here')", True)
End Sub



I hope this will work. thank you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900