0

我从服务器端调用 javascript 函数的地方有 2 个点。

Public Sub FNLocationName(ByVal location As String)
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "javascript", "SetMap('" & location & "')", True)
    End Sub


    Public Sub FNZoomLevel(ByVal IntZoomLevel As Integer)
        System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, GetType(Page), "javascript", "zoomSet('" & IntZoomLevel & "')", True)
    End Sub

但这给了我错误信息,undefined SetMap(locname)

我也试过:

Public Sub FNLocationName(ByVal location As String)
        Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", "javascript:SetMap('" & location & "')", True)
    End Sub


    Public Sub FNZoomLevel(ByVal IntZoomLevel As Integer)
        Page.ClientScript.RegisterStartupScript(Me.GetType(), "MyScript", "javascript:zoomSet('" & IntZoomLevel & "')", True)
    End Sub

但是使用这段代码,只有SetMap函数被调用,zoomset 也应该被调用。

可能是什么问题。

请帮我。

4

0 回答 0