DetailView1.clientHeight too small on resize

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;
}
 
B

bruce barker

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)
 
J

Joe Stateson

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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top