在asp.net中设置IE8缩放级别 [英] set the IE8 zoom level in asp.net

查看:78
本文介绍了在asp.net中设置IE8缩放级别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



VB.net,asp.net,VS2010

我已经建立了一个在gridview中显示各种数据的网站.
但是问题是正在使用的不同屏幕具有不同的分辨率,因此我必须去找用户并设置缩放级别,以便页面根据需要显示.

有什么办法可以将缩放级别设置为asp.net页面中我所需的75%或100%?

谢谢
Joe



VB.net, asp.net, VS2010

i have made a site that displays various data in a gridview.
but the problem is that different screens that are being used are at different resolutions so i have to go to the user and set up the zoom level so that the page displays as desired.

is there any way to set the zoom level to what i require like 75% or 100% within an asp.net page?

thanks
Joe

推荐答案

您可以使用 JavaScript 设置缩放级别

试试这个:
You can use JavaScript for setting the zoom level

Try this:
function SetResolution()
{
if(screen.width=1280)
  {
     var wdth = 1024; //Change this variable to match your configuration
     document.body.style.zoom = screen.width/1024;
  }
}



您可以将此代码放入.aspx主体中,并可以这样调用:



You can put this code inside the body of .aspx and can call it like this:

<body  onload="SetResolution()">



希望对您有所帮助:)



hope it helps :)


这篇关于在asp.net中设置IE8缩放级别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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