I am trying to resize a window to the same size as the DetailView. The
width is just fine, but the height is always slightly too small and I have
to add a constant. I have 4 of these detail views and each one is slightly
too small in height.
<script language="javascript" type="text/javascript">
// <!CDATA[
function formload()
{
var nH = DetailsView1.clientHeight + 100;
var nW = DetailsView1.clientWidth;
window.resizeTo(nW,nH);
}
// ]]>
</script>
</head>
<body onload="formload()">
================================
The window is launched using the following code:
function LaunchInfo(strPageName)
{
var windowAttribs = "toolbar=no,status=no, scrollbars=no,
resizable=no";
window.open(strPageName,"_blank",windowAttribs);
return false;
}

Signature
======================================================================
Joseph "Beemer Biker" Stateson
http://ResearchRiders.org Ask about my 99'R1100RT
======================================================================
bruce barker - 15 Oct 2007 23:54 GMT
you need to add in the body margins, padding and border, also for the
DetailsView1 you need to its border and margin. you could also set them
to 0px.
-- bruce (sqlwork.com)
> I am trying to resize a window to the same size as the DetailView. The
> width is just fine, but the height is always slightly too small and I
[quoted text clipped - 25 lines]
> return false;
> }
Joe Stateson - 16 Oct 2007 16:10 GMT
> you need to add in the body margins, padding and border, also for the
> DetailsView1 you need to its border and margin. you could also set them to
> 0px.
>
> -- bruce (sqlwork.com)
Thanks bruce, it is a lot easier to just use a constant rather than
calculate those items that are outside of the "client area"
I also found that firefox (unlike IE) could not find
"DetailsView1.clientHeight" when the asp body was below the jscript code
reference but the following worked fine.
function formload()
{
var obj = document.getElementById("DetailsView1");
var nH = obj.clientHeight + 100;
var nW = obj.clientWidth;
window.resizeTo(nW,nH);
}
>> I am trying to resize a window to the same size as the DetailView. The
>> width is just fine, but the height is always slightly too small and I
[quoted text clipped - 25 lines]
>> return false;
>> }