How to display a message in vb.net?

sha_shivani

Member
Joined
Sep 28, 2006
Messages
11
Programming Experience
1-3
I am using a ajax datebox control which validates the date.How do i display a mssage when user enters duedate less then today's date.I want to display somethng like "Duedate should be greater then today's date")
I was trying this but it gives me some parsing system error.Can somebody please give me the code for this?

If dbDueDate.Text <> "" Then
If Not (CType(dbDueDate.Text, Date) >= DateTime.Today.Date) Then
Response.Write("*Due date must be a valid date >+ todays date")
End If
End If
 
VB.NET:
If dbDueDate.Text <> "" Then

   If Date.Compare(Now.Date, CType(dbDueDate.Text, Date)) <= 0 Then
      messagebox.show("*Due date must be a valid date >+ todays date")
   End If
End If
 
I am getting this exception when i use this.

Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
 
VB.NET:
If dbDueDate.Text <> "" Then

   If Date.Compare(Now.Date, CType(dbDueDate.Text, Date)) <= 0 Then
      MessageBox.Show("*Due date must be a valid date >+ todays date", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly, False)
   End If
End If
 
Back
Top