Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

  • Moderators
Posted

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

Visit...Bassic Software
Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...