如何打开目标=" _blank"全屏?

时间:2014-04-24 18:27:46

标签: javascript html asp.net vb.net

我正在尝试全屏打开新页面。小尺寸是我的屏幕分辨率。我仍然需要点击浏览器上的重新调整大小按钮才能将其扩展为全屏。

如何在不点击re-sizeble的情况下打开填充屏幕?

Helper.Redirect("resource.aspx", "_blank",
                  "menubar=0,scrollbars=1,width=1366,height=768,top=10")

方法

Public Shared Sub Redirect(url As String, target As String, windowFeatures As String)
    Dim context As HttpContext = HttpContext.Current

    If ([String].IsNullOrEmpty(target) OrElse target.Equals("_self", StringComparison.OrdinalIgnoreCase)) AndAlso [String].IsNullOrEmpty(windowFeatures) Then

        context.Response.Redirect(url)
    Else
        Dim page As Page = DirectCast(context.Handler, Page)
        If page Is Nothing Then
            Throw New InvalidOperationException("Cannot redirect to new window outside Page context.")
        End If
        url = page.ResolveClientUrl(url)

        Dim script As String
        If Not [String].IsNullOrEmpty(windowFeatures) Then
            script = "window.open(""{0}"", ""{1}"", ""{2}"");"
        Else
            script = "window.open(""{0}"", ""{1}"");"
        End If

        script = [String].Format(script, url, target, windowFeatures)
        ScriptManager.RegisterStartupScript(page, GetType(Page), "Redirect", script, True)
    End If
End Sub

我尝试了'fullscreen=yes, scrollbars=yes,location=yes,resizable=yes'个参数。它不起作用。

1 个答案:

答案 0 :(得分:0)

尝试:

window.open('newWin.html','NewWindow','fullscreen=yes');

来源:

Here