【发布时间】:2018-12-02 08:56:18
【问题描述】:
我需要检查一些东西来决定是否显示警告。问题是javascript没有触发。有人可以帮我解释为什么。我已经在网上搜索过,看起来我的脚本很好。
这是我的代码:
Private Sub ShowWarning(ByVal ID As Integer)
Dim ds As DataSet = reminders.getJuryPaymentDueEvent(ID)
If ds.Tables(0).Rows.Count > 0 Then
Dim cs As ClientScriptManager = Page.ClientScript
Dim script As String = "javascript:confirm('There is a record and it will be deleted')"
cs.RegisterStartupScript(Page.GetType(), "confirm", script, True)
End If
End Sub
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
If hasorder() then 'there is other function which works fine
ShowWarning(ID)
'if confirm return ture
deleteOrder()
end if
End Sub
【问题讨论】:
标签: javascript c# asp.net vb.net