如何在ASP.NET应用程序中打开全屏浏览器编程? [英] How to open a browser in full screen in ASP.NET application programmatically?

查看:433
本文介绍了如何在ASP.NET应用程序中打开全屏浏览器编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在在ASP.NET 4.0中的Web应用程序。出于某种原因,我需要在全屏幕始终打开一个网站。它是一个乏味的任务在浏览器中打开一个网站,然后切换到全屏。

I am making a web application in ASP.NET 4.0. For some reason I need to open a web site always in full screen. It is a tedious task to open a web site in browser and then toggle to fullscreen.

有什么办法打开全屏幕编程浏览器(preferably IE9或谷歌浏览器)?
我可以把一些code在我的默认页在Page_Load()方法,切换浏览器全屏?

Is there any way to open the browser (preferably IE9 or Google Chrome) in full screen programmatically? Can I put some code in the Page_Load() method of my default page that toggles the browser to full screen?

推荐答案

我建议embeding JavaScript函数到你的ASP.NET code。使用window.open(),然后通过适当的参数。我用一些类似的JavaScript嵌入与.NET的Response.Write的。下面这个例子方法不会对window.open。只需按下适当的参数和URL等。

I'd suggest embeding a javascript function into your ASP.NET code. use window.open() and then pass the proper parameters. I used something comparable of embedding javascript into .net with Response.Write. This example method below does window.open. Just push the proper parameters and URL, etc.

BTW的参数是:HTTP:// URL','标题','型= fullWindow,全屏,滚动条=是'

The parameters btw are : 'http://URL', 'Title' , 'type=fullWindow, fullscreen, scrollbars=yes'

private void MessageBox(string URL, string parameters)
 {
     if (!string.IsNullOrEmpty(URL))
     {
         Response.Write
      ("<script type=\"text/javascript\" language=\"javascript\">");
         Response.Write("window.open('" + URL + parameters + "');");
         Response.Write("</script>");
     }
 }

这篇关于如何在ASP.NET应用程序中打开全屏浏览器编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆