Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/466.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 重定向引发未知错误_Javascript_Html_Asp.net_Vb.net - Fatal编程技术网

Javascript 重定向引发未知错误

Javascript 重定向引发未知错误,javascript,html,asp.net,vb.net,Javascript,Html,Asp.net,Vb.net,在我的网页中,我正在使用Response.Redirect将我的用户重定向到另一个页面。 我正在使用ASP vb.net,尝试重定向时出现以下错误: First exception of type 'System.Web.HttpException' in System.Web.dll 你知道怎么了吗 先谢谢你 这是我的代码: <AjaxPro.AjaxMethod(HttpSessionStateRequirement.ReadWrite)> Public Sub res

在我的网页中,我正在使用Response.Redirect将我的用户重定向到另一个页面。 我正在使用ASP vb.net,尝试重定向时出现以下错误:

First exception of type 'System.Web.HttpException' in System.Web.dll
你知道怎么了吗

先谢谢你

这是我的代码:

<AjaxPro.AjaxMethod(HttpSessionStateRequirement.ReadWrite)>
    Public Sub respuestaPeti(ByVal address As String, ByVal floor As String)

        Dim res As String

        res = pasarPeticion(address, floor)

        Try
            If res = "OK" Then
                Response.Redirect("https://www.google.es/")
            End If
            If res = "NO_OK" Then
                Response.Redirect("https://www.google.es/")
            End If
            If res = "OK_DIRMAL" Then
                Response.Redirect("https://www.google.es/")
            End If
        Catch ex As Exception
        End Try

    End Sub

公共子响应(ByVal地址作为字符串,ByVal楼层作为字符串)
作为字符串的Dim res
res=语音(地址、楼层)
尝试
如果res=“OK”,则
响应。重定向(“https://www.google.es/")
如果结束
如果res=“NO\u OK”,则
响应。重定向(“https://www.google.es/")
如果结束
如果res=“OK\u DIRMAL”,则
响应。重定向(“https://www.google.es/")
如果结束
特例
结束尝试
端接头

尝试以下代码重定向URL

Response.Redirect(URL,false)

它是否真的说“第一次机会例外”?如果是这样,那么可能根本就没有任何问题。请提供一个完整和清晰的解释,你看到什么,在哪里,什么时候。如果消息是我说的,你应该研究一下这个术语,看看它的实际含义。嗨,我试图在我的Public Sub中调用Response.Redirect,但它会引发System.Web.HttpException。我不知道他的类型,因为VS控制台没有提供任何信息。你知道要重定向的其他表单吗?我可能需要图书馆或其他什么吗?在我的索引页(page_load)中,它工作得很好。在这里的答案是否阻止了异常的产生?另外,请重新阅读JMCILHINEY评论的第一部分-可能没有问题。