[thelist] ASPX: Syntax for Multi-Line String Variable

Casey Crookston casey at thecrookstons.com
Wed Oct 6 14:15:24 CDT 2004


I hope all this code looks like it should once I hit send...  I'm putting
together a string variable which will become the body of an email:

  emailBody = "The following was submitted from the Membership Application
form:<br><br> " & _

      "First Name = " & first_name & "<br> " & _

      "Last Name = " & last_name & "<br> " & _

      "Address 1 = " & address_1 & "<br> " & _

      "Address 2 = " & address_2 & "<br> " & _

      "City = " & user_city & "<br> " & _

      "State = " & user_state & "<br> " & _

      "Zip = " & user_zip & "<br> " & _

      "Phone = " & user_phone & "<br> " & _

      "Mail = " & user_email & "<br> " & _

      "Profession = " & user_profession & "<br> " & _

      "How did you hear = " & how_hear & "<br> " & _

      "How did you find the site = " & how_find & "<br> " & _

      "Comments = " & q_and_c & "<br>"

It bombs out on the third line.  If I make it like this:

  emailBody = "The following was submitted from the Membership Application
form:<br><br> " & _

      "First Name = " & first_name & "<br> " & _

      "Last Name = "

then it works.  here's the error:

Compiler Error Message: BC30452: Operator '&' is not defined for types
'String' and 'System.Web.UI.WebControls.Label'.

Source Error:


Line 38:   dim emailSubject as string = "!! Membership Application from
StPaulRotary.org"
Line 39:
Line 40:   emailBody = "The following was submitted from the Membership
Application form:<br><br> " & _
Line 41:       "First Name = " & first_name & "<br>Last Name = " & last_name
& "<br> "
Line 42:




More information about the thelist mailing list