Open Asp.net Application in Fullscreen using javascript
Sometimes, we may have a requirement to open the asp.net application developed, to be opened in full screen mode. To accomplish this, below is the code, in login page, after verifying credentials we redirect user to home page.
So now using javascript, we have to use window.open and its fullscreen properties to open home page as follows:
StringBuilder popupScript = new StringBuilder();
popupScript.Append(“<script language=’JavaScript’> window.name = ‘windowname’;open(”, ‘windowname’); window.close();window.open(‘home.aspx’, ”, ‘fullscreen=yes,status=yes,scrollbars=yes,titlebar=no,addressbar=no’);</script>”);
ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), “PopupScript”, popupScript.ToString(), false);
On Logout, you can write the same script with fullscreen = no
Above code will also bypass the alert message we are getting when redirecting to another page using window.open in javascript.
It will by pass the message prompted
“The Web page you are viewing is trying to close the window” Do you want to close this window?
Leave a comment Cancel reply
Archives
Recent Posts
Categories
Blog Stats
- 291,135 hits
Recent Comments
Bhavesh Patel on Limiting the number of records… | |
Sumant on Validating Extension(eg. (.asp… | |
Gingsen on Limiting the number of records… | |
praveenkumar on Listbox select all using check… | |
asif on Limiting the number of records… |
Thank You very much…very good post.