我有两个 if 语句,我的项目只看到一个而不是另一个。这是代码:
If (IsPostBack) Then
HandleUploadedFile()
End If
Dim savePath As String = "Images\ "
If (fileUpload.HasFile) Then
Dim fileName As String = fileUpload.FileName
savePath = Server.MapPath(savePath) + fileName
fileUpload.SaveAs(savePath)
Me.Label1.Text = "Your file was saved as " & fileName
adp.Insert(fileUpload.FileName)
Me.Label1.Text = "You did not specify a file to upload."
End If
当我跟踪我的代码时,我发现它转到第二个 if ,然后在没有在条件内运行代码的情况下转到 end if 。