Response.Redirect引发了一个未知错误

问题描述 投票:-1回答:1

在我的网页中,我正在使用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
javascript html asp.net vb.net
1个回答
0
投票

尝试使用以下代码重定向URL。

Response.Redirect(URL,false)
© www.soinside.com 2019 - 2024. All rights reserved.