SPAM-LOW: [thelist] ASP.NET: testing an object for a value

Peter Brunone ( peter at
Mon Mar 7 14:28:25 CST 2005

Hi Tom,

   FYI, that's VB.NET, not VBScript (aside from syntax, the two are very dissimilar).

   Are you thinking of the RequiredFieldValidator?  If so, you could use one like this:

  runat=server />



 From: Tom Dell'Aringa pixelmech at

Hello again,

Still working on my form and have a question. I'm picking off the user's e-mail address from the
form like so (VB Script):

Dim objMM as New MailMessage()
objMM.From = txtEmail.Text

However,this is not required. But if they don't fill it in I get an error since the mail object (I
think) requires a sender.

How can I test objMM.From to see if it is blank, and if not supply a no-reply email like
(no-replay at so the email fires off?

Also, I thought I saw somewhere there was a simple way to require fields in ASP.Net...



More information about the thelist mailing list