我试过
Protected Sub btn_add_question_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_add_question.Click
frm_course.Visible = False
question_div.Visible = True
ScriptManager.RegisterClientScriptBlock(btn_add_question, Me.GetType(), "BlockName", "alert('hello world');", True)
End Sub
和
Protected Sub btn_add_question_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_add_question.Click
frm_course.Visible = False
question_div.Visible = True
Page.ClientScript.RegisterStartupScript(Me.GetType, "Javascript", "alert('hello')")
End Sub
但是,没有显示警报消息。需要帮忙 !!
<asp:Button ID="btn_add_question" runat="server" Text="Next" CssClass="btn_submit" Width="101px" />