I'm using ASP.NET (VB), and I'm trying to use a class to display a custom popup function (alert()
.
Code:
Public Class msgClass
Inherits System.Web.UI.Page
Public Shared Sub alert(ByVal msg As String)
Response.Write("<script>alert('" + msg.tostring + "');</script>")
End Sub
End Class
The problem here is that is says I need an explicit instance of a class to use response. (Not sure how to do that...)
This is how I call it in my main ASPX.vb page:
Code:
Dim a As New msgClass
a.alert(IsDate(txtStartDate.Text).ToString)
I've tried using Public Sub, but when it gets there, it tells me that "response..." can't be used like that.
Bookmarks