調用javascript函數的按鈕,點擊結束時,我試圖我如何在asp.net
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" />
使用視圖so在結果頁面上搜索並搜索'alert' - 它看起來如何? – Hogan 2012-07-24 18:38:30
另外,請發佈按鈕的asp代碼,也可能有錯誤。 – Hogan 2012-07-24 18:39:26
沒有找到任何'alert' – Ravi 2012-07-24 18:42:02