Wrox Programmer Forums
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 8th, 2003, 08:36 AM
Registered User
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Screen Resolutions

Screen Resolutions
Screen Resolutions

I am using the Java Script method window.showmodaldialog to display an ascx. I set the dialogWidth to 700px and dialogHeight to 500px, but it looks a bit naff on higher screen resolutions.

Does anybody know if I can use percentages for the width and height or if I can some how interrogate the users screen resolution and set the height and width accordingly.

Cheers,

A.
 
Old October 8th, 2003, 09:49 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Take a look here:

http://www16.brinkster.com/sparkwork...oningtest.html

You can interogate the browser, get the screen/browser dimensions, then calculate some size % for your popup.

Peter
 
Old October 9th, 2003, 03:29 AM
Registered User
 
Join Date: Oct 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks but I couldn't get it to work. This is the code I am using to load my modal browser:

' Inject Dialog Open Window Java Script
Dim script As String
script = "<script language=" & Chr(34) & "javascript" & Chr(34) & ">"
script = script & "window.showModalDialog
                  'ModalIframe.aspx',null,'status:no;dialogWidth:" & "self.screen.width"
                & ";dialogHeight:" & ls_DialogHeight
                & ";dialogHide:true;help:no;scroll:yes');"
script = script & "</script>"

Page.RegisterStartupScript("DisplayModalDialog", script)

It doesn't seem to pick up on the width unless I explicitly set it. Any ideas?
 
Old October 9th, 2003, 11:17 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

You're on the right track. You need to write a little javascript in your string...

script = script & "window.showModalDialog
                  'ModalIframe.aspx',null,'status:no;dialogWidth:" & "' + self.screen.width*.5 + '"
                & ";dialogHeight:" & ls_DialogHeight
                & ";dialogHide:true;help:no;scroll:yes');"

I added the *.5 so you'd get a 50% screen size dialog. Adjust as necessary.

Are you missing a ( before 'ModalIframe or was that just a paste error?

Peter





Similar Threads
Thread Thread Starter Forum Replies Last Post
Background Image for Different Resolutions Andraw Pro VB 6 0 November 6th, 2008 12:00 PM
resolutions issues jon_eaves BOOK: Beginning JavaServer Pages 3 May 22nd, 2005 11:51 PM
Screen resolutions larry Javascript How-To 7 July 21st, 2004 08:24 AM
Positioning pages to fit all screen resolutions? larry HTML Code Clinic 2 January 19th, 2004 05:27 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.