在一个sub的过程中每次用到Response.Write ("<script language=javascript>alert('游戏超时或网络异常,请重新登陆!');location.href='game-1.aspx';</script>")语句,都会提示BC30081: “If”必须以匹配的“End If”结束。请问是什么原因?代码如下<%@page Language=VB aspcompat=true%><script language="VB" runat="server">
Sub UploadFile(sender As Object, e As EventArgs)
If Len(FileUp1.value) > 0 Then
photo1 = Right(FileUp1.value,Len(FileUp1.value)-FileUp1.value.LastIndexOf("\")-1)
If Right(LCase(photo1),3) <> "jpg" Then

Response.Write ("<script language=javascript>alert('游戏超时或网络异常,请重新登陆!');location.href='game-1.aspx';</script>")
Response.End

End If
End If
End Sub</script>

解决方案 »

  1.   

    If Len(FileUp1.value) > 0 Then
    photo1 = Right(FileUp1.value,Len(FileUp1.value)-FileUp1.value.LastIndexOf("\")-1)
    end if
      

  2.   

    if then 结构如果后面换行的话必须以end if结束
      

  3.   

    都response.end了你的end if 当然执行不到了
      

  4.   

    我的if是嵌套的,不是两个分着的if语句,怎么处理呀,也就是
    If ..... Then
      If ..... Then
      .....
      End If
    End If
      

  5.   

    去掉response.end也是一样的报错