Alaric Posted October 8, 2003 Posted October 8, 2003 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. Quote
Moderators Robby Posted October 8, 2003 Moderators Posted October 8, 2003 Yeah, you can use JS to get the users' res then offset your width accordingly. you can use screen.width + screen.height also, window.screen.availWidth + window.screen.availHeight Quote Visit...Bassic Software
Alaric Posted October 9, 2003 Author Posted October 9, 2003 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:" & "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? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.