views:

538

answers:

3

Update 1:
Cannot reproduce this on a co-worker's computer (same setup as mine) so I assume this is a problem with my workstation and not a general one.

I'd appreciate it if someone would close this question as I don't have enough reputation to do it myself.

@MatthewMartin. Thanks for your comments :-)


Update 2:
Unlike my coworker, I have VS90sp1-KB945140-ENU.exe (SP1) and VS90SP1-KB957912-x86.exe (JS Intellisense hotfix) installed on my machine. That appears to be the only difference between our setups. I removed both of them, but that didn't solve my problem.


In my asp.net (C#) page is a little bit of Javascript to resize an object when the user resizes the window.

When I access the page using IE6 on my DEV server (IIS), it works.
When I access the page using IE6 via VS2008 using F5 or CTRL-F5 (both of which start the ASP.NET Development Server) it fails. It seems to enter an infinite loop of resizing where the adjSpreadsheetSize function fires the window.resize event, which invokes adjSpreadsheetSize ... Repeat ad infinitum

I see quite a few people out there complaining that IE6 can't properly handle onresize events, but nobody seems to be having this precise problem.

Any idea why this code works on IIS but not on ASP.NET Development Server?

Here's the relevant part of the code:

[snip]
<head>
[snip]
<script language="javascript" type="text/javascript">
 window.onresize = adjSpreadsheetSize;
 window.onload = pageSetup;

 //Change spreadsheet size to fill the window (viewport) below the entry form
 function adjSpreadsheetSize() {
  var objSS = document.getElementById("OWC_data");
  var winWidth = document.documentElement.clientWidth;
  var winHeight = document.documentElement.clientHeight;

  winHeight -= document.getElementById('form_body').offsetHeight;

  objSS.height = winHeight;
  objSS.width = winWidth;
  return false;
 }

 function pageSetup() {
  adjSpreadsheetSize();
 }
</script>

[snip]
</head>
<body>
<form id="form1" runat="server" action="rawdata.aspx" method="get">
<div id="form_body">
[snip]
</div>
</form>
<div id="OWC_container">
 <object id="OWC_data" classid="clsid:0002E559-0000-0000-C000-000000000046">
 </object>
</div>

My setup:

  • WinXP Pro SP2
  • Microsoft Visual Studio 2008 Version 9.0.21022.8 RTM
    • Installed Edition: Professional
    • Microsoft Visual Basic 2008
    • Microsoft Visual C# 2008
    • Microsoft Visual C++ 2008
    • Microsoft Visual Studio 2008 Tools for Office
    • Microsoft Visual Web Developer 2008
    • Crystal Reports Basic for Visual Studio 2008
  • Microsoft .NET Framework Version 3.5 SP1
  • The Website project lives on the DEV server (mapped as a local drive)
A: 

Since this is an activex object you're trying to load, maybe your MSIE is configured to trust http://localhost more than http://localhost:1235/foo ?

Other differences with IIS vs ASP.NET Development Server:

IIS only turns some files over to the aspnet filter, ASP.NET dev server turns all over to IIS.

Also, sometimes the change in port # will change behaviors.

MatthewMartin
A: 

I added
alert("Viewport: " + document.documentElement.clientHeight + " - formHeight: " + formHeight + " = " + winHeight);

For some reason, the div "form_body" flips back and forth between "421" and "435" (difference of 14). So I added a border to try and see where the change occurs... <div style="border: solid 1px red;" id="form_body">

And when the border is there, the resize works. Easily reproducible... add the border style, and the resize fires 3~5 times. Remove the border and it repeatedly fires for as long as I care to sit and watch it.

WTF?

Sukotto
A: 

Take a look at the explanation at the bottom of the blog post and see if that makes any difference for you:

http://radio.javaranch.com/pascarello/2005/02/16/1108571848000.html

Eric

epascarello