我有一个确认框。如果用户单击框上的确定,我想调用一个函数。代码如下。
Dim message As String = " An Assessment for this date already exists. To create another one for this date click OK OR else click CANCEL to go back to Assessment History. "
Dim sb As New System.Text.StringBuilder()
sb.Append("<script type = 'text/javascript'>")
sb.Append("window.onload=function(){")
sb.Append("if (confirm('")
sb.Append(message)
sb.Append("')){ ")
sb.Append("}")
sb.Append("else{")
sb.Append("window.location = 'SA.aspx?PID=" & Request("PID") & "';")
sb.Append("}};</script>")
ClientScript.RegisterClientScriptBlock(Me.GetType(), "confirm", sb.ToString())