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

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Wed Oct 6 14:41:59 CDT 2004


Casey,

	Any chance you have a label called last_name?

	FWIW, the StringBuilder class is a much more efficient way to do
large string concatenations like this.

Cheers,

Peter

-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Casey Crookston

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