gpt4 book ai didi

asp.net - 如何在 vb 中创建警报弹出消息?

转载 作者:行者123 更新时间:2023-12-02 14:05:24 26 4
gpt4 key购买 nike

如何在单击按钮时在 vb 中创建弹出警报消息?

这是我的页面加载代码,如下所示:

Imports System.Net.Mail
Imports System.IO
Imports System.Text
Public Class locker
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Request.IsAuthenticated Then
WelcomeBackMessage.Text = "Welcome back!"


AuthenticatedMessagePanel.Visible = True
AnonymousMessagePanel.Visible = True
Else
AuthenticatedMessagePanel.Visible = False
AnonymousMessagePanel.Visible = True
End If

Dim ident As FormsIdentity = CType(User.Identity, FormsIdentity)
Dim authTicket As FormsAuthenticationTicket = ident.Ticket
WelcomeBackMessage.Text = "Welcome, " & User.Identity.Name & "!"

End Sub


Protected Sub send_Click(sender As Object, e As EventArgs) Handles send.Click
<<<<----------popup message coded here------------>>>>>>>>>
End Sub
End Class

最佳答案

如果你想弹出消息框,只需在按钮代码中添加以下内容即可:

onclientclick="javascript:alert('Congratulations!');"

或者在后面的代码中:

Response.Write("<script language=""javascript"">alert('Congratulations!');</script>")

关于asp.net - 如何在 vb 中创建警报弹出消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26097352/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com