Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Page size and location on Page Load

Page size and location on Page Load

Scheduled Pinned Locked Moved ASP.NET
javascriptquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bubberz
    wrote on last edited by
    #1

    I am opening a page from a hyperlink, and want to set it's dimensions to 400x400, and put it in the middle of the page. I know I'll probably have to do this with javascript, but how? Can it be done in Page_Load? Thanks!

    S 1 Reply Last reply
    0
    • B bubberz

      I am opening a page from a hyperlink, and want to set it's dimensions to 400x400, and put it in the middle of the page. I know I'll probably have to do this with javascript, but how? Can it be done in Page_Load? Thanks!

      S Offline
      S Offline
      SABhatti
      wrote on last edited by
      #2

      if you are trying to open a page in new window then try window.open(url,windowname,features) example url="mypage.aspx", windowname="mywindow" var wtop=screen.height-400/2; var wleft = screen.width-400/2; features="width=400,height=400, top="+ wtop +", left="+ wleft +"" Salim Akbar

      B 1 Reply Last reply
      0
      • S SABhatti

        if you are trying to open a page in new window then try window.open(url,windowname,features) example url="mypage.aspx", windowname="mywindow" var wtop=screen.height-400/2; var wleft = screen.width-400/2; features="width=400,height=400, top="+ wtop +", left="+ wleft +"" Salim Akbar

        B Offline
        B Offline
        bubberz
        wrote on last edited by
        #3

        Thanks Salim! That's what I found more or less on the web!

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups