Results 1 to 2 of 2

Thread: Message box in Asp.Net

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Location
    Denmark
    Posts
    1,049

    Question Message box in Asp.Net

    Is it possible to create a message box in ASP.Net in this code:
    Code:
    sub test()
    dim tester as single
    try
       tester = Csng(txtBox1.text)
    catch
       ((Show message box with text: "Please enter a number"))
    end try
    Maybe I forgot to make some Imports System.Web.?????

  2. #2
    Frenzied Member Memnoch1207's Avatar
    Join Date
    Feb 2002
    Location
    DUH, Guess...Hint: It's really hot!
    Posts
    1,861
    messagebox in ASP.NET isn't possible, but you can create a javascript alert to run if a button is clicked.
    VB Code:
    1. Private Sub btnUpload_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUpload.Click
    2.         If (myExpression <> True) Then
    3.             Dim strScript As String = ""
    4.  
    5.             strScript = "<script>"
    6.             strScript = strScript & "alert('You must select a file to upload');"
    7.             strScript = strScript & "</script>"
    8.  
    9.             'Allows the alert box to be shown without wiping
    10.             'the controls off the page.
    11.             Page.RegisterStartupScript("ClientScript", strScript)
    12.      End If
    13. End Sub
    Being educated does not make you intelligent.

    Need a weekend getaway??? Come Visit

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width