How to write code in page load to display that window size like popup?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ganesh22
    Banned
    New Member
    • Sep 2007
    • 81

    How to write code in page load to display that window size like popup?

    Hi,
    How to write code in page load to display that window size like popup?

    ex:
    Here i writen the code in OnClientClick event now i want in page load

    javascript:wind ow.open('Defaul t4.aspx?a=' ,null,'height=5 50,width=550,st atus=no, resizable= no, scrollbars=yes, toolbar=no,loca tion=no,menubar =no ')"
  • deric
    New Member
    • Dec 2007
    • 92

    #2
    I'm not sure if I completely understand you, but is this the code you're looking for
    Code:
    <html>
    <head><title>Title Here</title></head>
    <body [B]onload=[/B]"javascript:window.open('Default4.aspx?a=' ,null,'height=550,width=550,status=no, resizable= no, scrollbars=yes, toolbar=no,location=no,menubar=no ')">
    
    </body>
    </html>

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Originally posted by ganesh22
      Hi,
      How to write code in page load to display that window size like popup?

      ex:
      Here i writen the code in OnClientClick event now i want in page load

      javascript:wind ow.open('Defaul t4.aspx?a=' ,null,'height=5 50,width=550,st atus=no, resizable= no, scrollbars=yes, toolbar=no,loca tion=no,menubar =no ')"
      You could use the JavaScript Window.Onload event....
      eg:
      [code=Javascript]
      window.onload=d isplayWindowSiz e();
      //displayWindowSi ze() is a function that does what you want it to do....
      [/code]

      This will run once the web page is finished loading in the browser.


      You could also use: <body onload="display WindowSize();"> which will run the displayWindowSi ze() function when the body has finished loading.

      If my memory serves me right, you have to place the displayWindowSi ze() method in the <head> section of your page if you use <body onload="display WindowSize();"> .....otherwise I don't think it will work properly.

      -Frinny

      Comment

      Working...