Question

Hi, I'm currently having a difficult time answering this question on how I can validate a...

Hi, I'm currently having a difficult time answering this question on how I can validate a drop down list for a web code in Microsoft Visual Studio. What does it mean when I receive an "End of statement expected" error? Am I using the correct format? It only seems to be "IsNothing" that keep causing the error message under the ' Ensure a Taco Selection is Selected comment:

' Project: Street Tacos Order Form
' Author: Richard Lew
' Date: November 3, 2019
' Purpose: The web application allows a customer to fill out a street taco order form.

Public Class About
Inherits Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

End Sub

Protected Sub btnSubmit_Click(sender As Object, e As EventArgs) Handles btnSubmit.Click
' The btnSubmit click event will calculate the cost of the street tacos
' based on the type of tacos selected.

' Declare and initialize variables
Dim decChickenCost As Decimal = 8.99D
Dim decPorkCost As Decimal = 9.99D
Dim decFishCost As Decimal = 12.99D
Dim decBeefCost As Decimal = 13.99D
Dim decExtraCost As Decimal = 0.99
Dim strName As String
Dim strAddress As String
Dim strPhone As String
Dim decOrderCost As Decimal = 0D
Dim strMessage As String

' Trim additional spaces that are entered by the user
strName = txtName.Text.Trim
strAddress = txtAddress.Text.Trim
strPhone = txtPhone.Text.Trim

' Clear the Order Message
lblOrder.Text = ""

' Ensure a Taco Selection is Selected
If ddlTacoType.SelectedIndex IsNothing Then
MsgBox(lblTacoTypeError)
End If
End Sub
End Class

0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • Try using IsNothing (ddlTacoType.SelectedIndex ) instead of ddlTacoType.SelectedIndex IsNothing
  • Definition:
    • public Function IsNothing(System::Object^Expression) As Boolean
  • If the above doesn't work use Is Nothing instead of IsNothing
Add a comment
Know the answer?
Add Answer to:
Hi, I'm currently having a difficult time answering this question on how I can validate a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT