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
Hi, I'm currently having a difficult time answering this question on how I can validate a...