本文介绍了单击按钮绑定数据后如何显示弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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.

推荐答案


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.


这篇关于单击按钮绑定数据后如何显示弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 21:11