Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

DetailView1.clientHeight too small on resize

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe Stateson - 15 Oct 2007 21:04 GMT
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;
>> }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.