Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
HeadersLiteral.Text = If(contentType IsNot Nothing ,  "Content-Type: " & contentType & "<br />", String.Empty))
            HeadersLiteral.Text += (If(contentTransferEncoding IsNot Nothing, "Content-Transfer-Encoding: " & contentTransferEncoding, String.Empty)

The error is shown on if condition.
Any one please solve the error and please make an update.

error: experssion expected
Updated 8-Jun-11 21:28pm
Sergey Alexandrovich Kryukov 9-Jun-11 1:53am    
Tag the question properly: language, platform, UI library if applicable, etc.

Under "if" statement Boolean expression is expected: result of comparison or result of Boolean operator. Isn't that natural? It should be something returning True or False. Instead, you write Boolean expressions delimited by ',' (comma). Comma is not a Boolean operator.

Share this answer
If appears as if you wrote your If statements like you were writing them in Excel:
If(condition, returnIfTrue, returnIfFalse)

That's not how it work in VB.NET:
If condition Then
End If
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900