You 100% can do this on the server side...
Protected Sub Button3_Click(sender As Object, e As System.EventArgs)
MesgBox("Test")
End Sub
Private Sub MesgBox(ByVal sMessage As String)
Dim msg As String
msg = "<script language='javascript'>"
msg += "alert('" & sMessage & "');"
msg += "</script>"
Response.Write(msg)
End Sub
here is actually a whole slew of ways to go about this http://www.sislands.com/coin70/week1/dialogbox.htm