tags:

views:

186

answers:

1

Hello All,

I am working with the following code:

If chkApproximately.Checked Then
'.Item_Title = "~ " & String.Format("{0:N0}", Int32.Parse(Me.txtQuantity.Text)) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim  'txtItem_Title.Text.Trim
.Item_Title = "~ " & String.Format("{0:N0}", Me.txtQuantity.Text) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim  'txtItem_Title.Text.Trim
Else
.Item_Title = String.Format("{0:N0}", Me.txtQuantity.Text) & " " & IIf(Me.ddlUnits.Text = "Piece(s)", "", Me.ddlUnits.Text & " of ") & Me.ddlCategory.SelectedItem.Text.Replace("-", "").Trim 'txtItem_Title.Text.Trim
End If

When I run the aspx page on the web server, provide values and submit the form, I receive the error message stated in the question header. Can someone explain why this is happening and provide some suggested solutions?

Thanks, Sid

A: 

Guessing.. try '+' instead of '&'

Xinxua
SidC
and do a CStr if you got a integer value. Also it occurred to tell you to check if the Int32.Parse has proper integer text and not empty string.
Xinxua
I commented out the first line as we don't want to do the int32.parse. TxtQuantity is set to long in the library. Thus, I commented out the original code and copied it, removing the int32.parse. Anything else I should do? Thanks much!!
SidC
SidC

related questions