views:

951

answers:

3

Hi In asp.net website, I would like to add button by which user can view the page in Full Screen mode and switch back to Normal mode. [This is same as happens with F11]

I have seen many javascript code but all of them is opening new window in full screen.

But i would like have same window in Full screen

If it happn then i will put that button in MASTER page.

Please help?

+8  A: 

I don't think it is possible to do what you are asking.

The only possible way is using window.open:

<span onclick="window.open('http://www.yourdomain.com/page.html','', 'fullscreen=yes, scrollbars=auto');">Open Full Screen Window</span>

(I'm not sure it's a good idea to force a user to use full screen mode...)

CD
I think the reason it is not possible is exactly that: Not a good idea to force the user.
awe
Something that annoys me a lot are bogus <a> elements. i.e. links that are actually not links. If you're not linking to a new document, then don't use the link element.Every HTML element supports the onclick event. So use <span onclick="...">...</span> and not <a>.
elmuerte
This only works in IE. Tested not working on Firefox, Safari, Chrome and Opera.
awe
A: 

User already has this button, it's called F11.

DO NOT try to be 'smart'. This kind of functionality is in browser's scope, not in web application scope. It should not be your concern at all.

Instead focus on features that are truly relevant to your application.

Bragi Ragnarson
Many users on the web are not aware of F11 (the only one they use is F1, but that is only because they have a keyboard where the F1 key also have a sub text saying **Help**).
awe
I think @awe is right, many users don't know about "F11". Isn't it good to have button at web page for Full screen and for Normal mode
Hemant Kothiyal
+3  A: 
ugly solution but it works



<head>  
   <script type="text/javascript"> 
        function max() 
        { 
            var obj = new ActiveXObject("Wscript.shell"); 
            obj.SendKeys("{f11}"); 
        } 
    </script> 
</head> 
<body onload="javascript:max()">
</body>
bogdanbrudiu
ugly solution, and ugly support. Only IE... But, as you said. It works.
peirix
I tried it, but does not work. Tried in IE7, Firefox and Chrome. Error: ActiveX object not defined. I am running Vista.
awe