1. <wbr id="m8vu6"></wbr>

      <del id="m8vu6"><center id="m8vu6"><source id="m8vu6"></source></center></del>
        <p id="m8vu6"><sub id="m8vu6"></sub></p>

        VB.net 2010 視頻教程 VB.net 2010 視頻教程 VB.net 2010 視頻教程
        SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
        當前位置:
        首頁 > 編程開發 > .net教程 >
        • ASP.net教程之C# 跳轉新的標簽頁

        • 2019-06-18 21:52 來源:未知

        ///這個是拿別人的,找到好多這個方法,溜了,不知道誰是原創

        protected void btnPrint_Click(object sender, EventArgs e)
                {
                    string url = "QR_CodePrintView.aspx?Code=" + tbAssetCode.Text + ";";
                    Redirect(Response, url, "_blank", "'toolbar=0,scrollbars=1,status=0,menubar=0,resizable=1,top=0,left=0,height=800,width=1000");
                }
                /// <summary>
                /// 打開新的標簽頁
                /// </summary>
                /// <param name="response"></param>
                /// <param name="url"></param>
                /// <param name="target"></param>
                /// <param name="windowFeatures"></param>
                private void Redirect(HttpResponse response, string url, string target, string windowFeatures)
                {
                    if ((String.IsNullOrEmpty(target) || target.Equals("_self", StringComparison.OrdinalIgnoreCase)) && String.IsNullOrEmpty(windowFeatures))
                    {
                        response.Redirect(url);
                    }
                    else
                    {
                        Page page = (Page)HttpContext.Current.Handler;
                        if (page == null)
                        {
                            throw new
                            InvalidOperationException("Cannot redirect to new window .");
                        }
                        url = page.ResolveClientUrl(url);
                        string script;
                        if (!String.IsNullOrEmpty(windowFeatures))
                        {
                            script = @"window.open(""{0}"", ""{1}"", ""{2}"");";
                        }
                        else
                        {
                            script = @"window.open(""{0}"", ""{1}"");";
                        }
                        script = String.Format(script, url, target, windowFeatures);
                        ScriptManager.RegisterStartupScript(page, typeof(Page), "Redirect", script, true);
                    }
                }

        相關教程
        免费看成年人视频大全_免费看成年人视频在线观看