How to open new web page that is not maximised

davearia

Centurion
Joined
Jan 4, 2005
Messages
184
Hi All,
Code:
<a class="glink" id="gl3" title="Get An OnlineCalculation" href="http://localhost/mip/default.aspx?Action=1003" target="_blank">Estimate</a>
This code will currently open a new web page. But I would prefer to set its size something other maximised and also centre it to the screen.

I have tried adding width & height attributes but the are not recognised in Visual Studio and make no difference when the code runs

Please help.

Thanks, Dave. :D :D :D
 
Add the following javascript code behind your page in the appropriate location:
Code:
		function newWindow(){
				var doc = document.forms[0];
				window.open("http://localhost/webAppFTP/WebForm2.aspx", "Welcome", "width=350, height=25, resizeable=0, menubar=no, scrollbars=no, status=yes, left=0 , top=0")
			}

Add the following code to the button that opens the new page:
Code:
Me.btnWindow.Attributes.Add("onClick", "return newWindow();")

Your are going to have to mess around with the variables to get the correct size and location that you want.

Mike55
 
Back
Top