BUG/PRODUCTION-DOWN: UserControl running from HTML not working.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

BUG/PRODUCTION-DOWN: UserControl running from HTML not working.

Someone please help,

I have a production down situation. For whatever reason, UserControls are
not owkring from HTML/IE. When script tries to run a UserControl's method or
use a property, IE gives an error "Object doesn't support this property or
method".

Example:

<html>
<body>
<object
id=objTest
classid="Test.dll#Test.TestControl"
style="display: none;"
VIEWASTEXT</object>
</body>
<script language=javascript>
var objTest;
objTest = document.getElementById("objTest");
var csHello = objTest.RunTest("Hello");
alert(csHello);
</script>
</html>

I've posted this error in other formats, thinking it was something I was
doing in relation to IE/XP, but I've confirmed that even on 2000 machines,
bosting hosting the IIS and running the IE are giving the same error now for
some reason.

Something has changed, in either IE, IIS, XP/2000, and/or Visual Studio .NET
2003 that is causing this VERY simple .NET UserControl from working. As a
double check, our IIS virtual directories are set to ONLY run script. We know
of the IIS/UserControl issue that if the virtual directory is set to run
executables, that the UserControl will not run.

The strange thing is that if we run the OBJECT tag from the Visual Studio
..NET 2003 debuggger for any of our virtual directories, that the UserControls
then works correctly. But if ran from IE on its own, we get that error.

It is as if, for some reason IE will simply no longer run UserControls, even
if it "trusts" the server.

Please give advice.
 
The first question I would ask is what did you do that recently changed
on these machines? If you are saying it is a "PRODUCTION-DOWN" situation
(which makes me assume that you had this working at one point), it would
mean that something has changed in the environment to cause this.

So what changed?
 
Thank you for the reply,

Basically, we had a UserControl and we added a new method, and deployed it.
But on some machines, that error "Object doesn't support this method or
property" appeared when user try to run HTML that uses the new method. It
completely confounded us. I went down the path to make a sample for
Microsoft, and started with a simple "Test" UserControl, and got the same
error, right off the bat?!?!? Unless I ran it from the debugger?!??! At first
I thought it was an XP issue as the users on 2000 were not getting the error,
and the debugger could run it. But then we got a 2000 user to reproduce it.
So.... we are stumped.

It almost seems as if IE is holding an "old" reference to the previous
UserControl that did not have the method, and is there for unable to find the
new method. I'm going to try and rule that possibility out by making another
UserControl called something other than "Test" like I sent in the sample, as
I have used that name before. I'll post back when I know more.

In the mean time, has anything changed in IE/XP/2000 as far as service packs
or updates that could affect UserControls?
 
I have an update to this issue.

I made another Test UserControl called "TestNumber3" so that the CLASSID
would be as such: "TestNumber3.dll#TestNumber3.UserControl1" And it
worked?!?!?! I then changed the UserControl to have a new method and updated
the script to call the new method. Then the moment I refreshed the web page I
got the "Object doesn't support this method or property". I also found, that
the only way I could get the UserControl to work was to completely exit out
of all of my IE instances. If I even left one running, and tried to run the
UserControl again, I got the same error, and this included the Visual Studio
..NET, if I opened the web page that hosted the OBJECT tag.

So, it is obvious, that IE is holding the "old" UserControl and not updating
it on refreshes. This explains our PRODUCTION-DOWN. I'll pass word to our
support to be advised of this.

Why is IE doing this? Can we add script to FORCE IE to get any "new" updates
to a UserControl without having to rename its "name space" or "control name"
or DLL name? I did try setting the IIS to "Enable Content Expiration" to
expire immediately, but this did not change anything. I also tried using
"<meta name=expires content='06 July 2005'>" and that made no difference.
Only exiting ALL IE sessions works.

Any ideas?
 
I have another update. We "seem" to be back into production. We are
concluding the following has lead to this issue:

1) IE is definately holding onto older version, even if a user brings up an
unrelated web page in says "Session A", and then brings up the UserControl in
"Session B".

2) Also, the IIS setting "Enable Content Expiration" causes the control to
NEVER update if it is set to "Expire immediately". In this case, even if all
IE sessions are closed down, the USerControl NEVER updates?!?!?

So, in closing, we simply have to ask, we are these things ture? Is there
any way to FORCE IE to refresh the USerControl?
 

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

Back
Top