Hello everybody, after spending the better part of the day yesterday searching through the forums I believe I put together a solution for starting your ASP.NET application without the address bar, toolbars, etc.
There are many discussions about this in forums.asp.net but i could not find one that would give a clear answer so I decided to write this post and maybe I can save some time for the next person looking for this solution.
The problem: I cannot adjust the browser to hide the toolbar, menubar, address bar... when it is launched by the user and I desperately need the vertical space while all the browser add ons are useless for my application.
Solution: Create a splash screen (a new web form) and enter the folowing script in the "Load_Complete" event sub.
ScriptManager.RegisterStartupScript(Me.Page, Me.GetType(), "Script", "<script language='javascript'>NewWin=window.open('UserLogin.aspx',null,'width=' + screen.width + ', height=' + screen.height + ', top=0, left=0, resizable=yes,menubar=no,toolbar=no,location=no,directories=no,status=no');window.open('','_self','');setTimeout('self.close();',5000);</script>", False)
Note: Where 'UserLogin.aspx' you should type the name of the form that you wish to have as startup form. You can also adjust the duration that the splash screen will stay on by changing the value in the setTimeout function. I think '5000' will do 5 seconds.
Now set the splash screen as your startup form and run it.
In this examble the browser will start with all the toolbars showing and it will display your splash screen. In the mean time it will open a new window without the toolbars and after waiting 5 seconds, it will close the window that the user launched (splash screen).
The problem was that without the statement window.open('','_self','');, Internet Explorer will prompt the user to confirm that the instance he/she launched is going to close.
This statement makes Internet Explorer think that the instance was launched through code and it closes without a message.
I would like to give credit to the programmer that posted the above statement on a forum but I went through so many forums that I could not find that post again. My apologies to the programmer.
John V.