Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a new browser window controlling the size 1

Status
Not open for further replies.

kyledunn

Programmer
Jan 2, 2001
145
US
I need to open a new browser window when clicking on a button and control the size and features of the new window. Can anyone help?
 
This is really more of a JScript/JavaScript question.

Plug the following script into page:
Code:
<script language=&quot;JavaScript&quot;>

function OpenWin(sURL)
{
	myWin= open(sURL, &quot;myWindow&quot;, &quot;width=320,height=240,status=no,toolbar=no,menubar=yes,resizable=yes,scrollbars=yes,screenX=0,screenY=0&quot;);
	myWin.resizeTo(320,240);
	myWin.moveTo(0,0);
	myWin.focus();
</script>
Call with a button's onClick event:
onClick=&quot;javascript:OpenWin('myPage.htm')&quot;

:)
 
Thanks for your reply.

I now realize that I can only open a featured controlled browser window from the client side.

My objective was to authenticate a user using asp.net forms authentication and if authenticated have it open the app in a feature controlled browser window (smaller without menus). The button that initiated the form authentication on the server executed both the client side onclick event as well as the server side click event meaning I couldn't authenticate before opening the featured controlled browser window. I settled for authenticating and if successfully authenticated returning the app to the current browser window while adding a button to allow executing the javascript for a featured controlled window. Not very elegant but I don't see any options for controlling the browser window features from a server side web control or executing client side java without a client side event. Do you know of any way to have a page load that will then without user intervention execute a javascript function?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top