![]() |
page size...
I have a pop window that is displayed and depending on the state of the
system it will contain any number of user controls(ascx). These controls contain dynamic content and therefore the size of the control can change dynamically. Is it possible to work out the size of the page that is going to be displayed from the code behind page and then resize the pop window accordingly? Cheers Earth Worm Jim |
Re: page size...
Ouch sorry. Didn't see...
"Jim" <ssss> wrote in message news:OCoTCV8kDHA.2500@TK2MSFTNGP10.phx.gbl... > I have a pop window that is displayed and depending on the state of the > system it will contain any number of user controls(ascx). These controls > contain dynamic content and therefore the size of the control can change > dynamically. > > Is it possible to work out the size of the page that is going to be > displayed from the code behind page and then resize the pop window > accordingly? > > Cheers > > Earth Worm Jim > > > |
Re: page size...
Yes I think it is.
I IE you could generally use getBoundingRect() function to retrieve the size of your controls, even if they have no constant size (width or height params within style element) for example <script> function changeWindowSize() { var oSizingControl = document.getElementById('sizingControl'); width = oSizingControl.getBoundingClientRect().right - oSizingControl.getBoundingClientRect().left; height = oSizingControl.getBoundingClientRect().bottom - oSizingControl.getBoundingClientRect().top; window.resizeTo(width + 25, height + 50); } </script> <body onload="changeWindowSize()"> <asp:Label runat="server" id="sizingControl">Here is my text, i don't know the width and height of</asp:Label> </body> I hope that helped... "Jim" <ssss> wrote in message news:OCoTCV8kDHA.2500@TK2MSFTNGP10.phx.gbl... > I have a pop window that is displayed and depending on the state of the > system it will contain any number of user controls(ascx). These controls > contain dynamic content and therefore the size of the control can change > dynamically. > > Is it possible to work out the size of the page that is going to be > displayed from the code behind page and then resize the pop window > accordingly? > > Cheers > > Earth Worm Jim > > > |
| All times are GMT. The time now is 07:50 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.