Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

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
Posted
Comments
Uday P.Singh 6-Oct-11 14:47pm    
what is your issue? does gridview items are not visible?

1 solution

You can use JavaScript for setting the zoom level

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


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

HTML
<body  onload="SetResolution()">


hope it helps :)
 
Share this answer
 
v4
Comments
joe_j 6-Oct-11 15:40pm    
Thanks for that Uday.
my doubt is, i have to put this javascript inside an aspx page that is inherited from a masterpage, so where do i put this code and how to i call it to check the screen size on load. hope that you can help me on this
Uday P.Singh 6-Oct-11 15:51pm    
I updated the answer, for further queries comment here!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900