DetailView1.clientHeight too small on resize

  • Thread starter Thread starter Joe Stateson
  • Start date Start date
J

Joe Stateson

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;
}
 
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)
 
bruce barker said:
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);
}
Joe said:
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;
}
 
Back
Top