• Archive,  Uncategorized

    Automatic postback does not fire for TextBox control

    I recently come across an interesting request which read like this: A simple webapplication with one Textbox and one label. The Textbox has Autopostback=”true” and has an event listener attached to the TextChanged event. In the TextChanged event the label’s text is set to the text in the textbox. A javascript function “formats” the value of the textbox on the keyUp event.   The ”problem” The postback is not fired for a textbox if a javascript function sets the value of the textbox in the keyDown or keyUp event. This only occurs in IE (IE 8, IE 7, FF 3.6.8, Opera 10.6 and Chrome 5 has been tested). No javascript errors or any kind of error message, the postback is just not being fired. And here’s a sample page to reproduce the problem: <%@ Page Language="vb" AutoEventWireup="false" ValidateRequest="false" EnableEventValidation="false" EnableViewStateMac="false" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script type="text/javascript" language="javascript"> function FormatTextBox(obj) { //This is just a dummy function that adds $ as the first character. var value = obj.value if (value.length > 0 && value.charAt(0) != '$') value = '$' + value; obj.value = value; // This line causes the autopostback not to fire. This only…

  • Uncategorized

    How many application pools can you cope with?

    This is an interesting question I have to admit I had not thought to until we got a case from a customer whom was in trouble with his production servers: how many application pools can you run on IIS? Event better, how many w3wp.exe instances can the OS cope with? As quite often happens in our job, the correct answer is: it depends… First, the problem. The customer was a hosting company so they had a large numbers of sites on each web server, around 450, each of them with its own application pool, each application pool run under its own specific account and aspExecuteInMTA was set to 1 on each server. Under some circumstances asp applications from some web sites are failing with the following message (roughly translated from Spanish): Server error ‘ASP 0177 : 80070057’ Error in Server.CreateObject /site/page.asp, line 338 80070057 When the problem occurred the customer recycled the two or three top consuming web sites in terms of memory, threads and handles; then the failing web site was usually back online. Note that the failing web site was always only affected by other problematic ones, it was almost never the culprit. At first we were distracted…

  • Uncategorized

    Don’t let IE local cache drive you crazy!

    I stumbled across this issue multiple times during my life of web developer (which begun about 10 years ago), it appeared every now and then to complicate things when I was in the middle of a heavy debugging sessions and doing frequent changes to my pages; I was expecting some kind of results but despite the fact that the code was looking good, there were no signs of those changes. Sometimes even adding a new UI element like a button or an image or changing the color of a header had no effect… ? Having a look at the page source within IE demonstrated the browser was somehow right not showing the new image or color because it was not there in the code… where was that source coming from? ? Well, if it does not come from the web server, then it’s loaded from the IE local cache… so let’s go to Internet Options > General > Delete > Temporary Internet Files, give it another try and guess what? This time it works…! So, not sure why, but for some reason IE was not refreshing its case and was using an outdated version of my pages. Then after a…

  • Uncategorized

    A Trappable error C0000005 occured in an external object, the script cannot continue running

    This is an Access Violation exception which can have different causes (MDAC bad installation, third party components such as Oracle dlls which Oracle has a fix for etc…), but in the specific case I had some time ago this was due to a corrupted Windows Scripting Host engine. This was a classic ASP application and it was crashing randomly; we captured a dump with adplus (4 dumps, actually) and the stack of the faulting thread was always the same: 0:020> kpL2000 ChildEBP RetAddr 04f5f5c8 7346520b vbscript!VarStack::SetMasterSp(long cvar = 6, class VAR ** ppvarSp = 0x04f5f6b8)+0xa3 04f5f5e4 7346492e vbscript!CScriptRuntime::Init(class CSession * psess = 0x00000000, class FncInfo * pfin = 0x04654e28, class VAR * pvarThis = 0x00000000, int cvar = 0, class VAR * prgvar = 0x00000000, unsigned long grfcall = 0)+0x265 04f5f6f0 73464cd2 vbscript!CScriptEntryPoint::Call(class VAR * pvarRes = 0x00000000, int cvar = 0, class VAR * prgvar = 0x00000000, class VAR * pvarThis = 0x00000000, unsigned long grfCall = 0)+0x4a 04f5f748 73465522 vbscript!CSession::Execute(class IEntryPoint * pep = 0x04654e20, struct tagVARIANT * pvarRes = 0x00000000, int cvar = 0, struct tagVARIANT * prgvar = 0x00000000, struct tagVARIANT * pvarThis = 0x00000000, unsigned long grfscr = 0)+0xb4 04f5f798 7346189b vbscript!COleScript::ExecutePendingScripts(struct tagVARIANT * pvarRes…

  • Uncategorized

    Server Error 500, unable to create new session

    I saw this problem reported on a Windows 2000 Server (IIS 5.0), I’ve not checked if the same could also happen on IIS 6/7… The application is build on classic ASP pages and the error appeared about once per day on a test server; when browsing the user got a message reading "unable to create new session" (rough translation from Italian), and when this happens the only solution was to reset IIS (while in that status, even static HTML content was not served). Interestingly the Event Log showed quite a few entries like the following: Event Type:  Warning Event Source: COM+ Event Category: Activation Event ID:    4238 Date:        03/07/2007 Time:        11.05.49 User:        N/A Computer:    xxxxxxxx Description: COM+ has determined that your machine is running very low on available memory.  In order to ensure proper system behavior, the activation of the component has been refused.  If this problem continues, either install more memory or increase the size of your paging file.  Memory statistics are: dwMemoryLoad = 98 dwTotalPhys = 536358912 dwAvailPhys = 9453568 dwTotalPageFile = 1945448448 dwAvailPageFile = 48668672 dwTotalVirtual = 2147352576 dwAvailVirtual = 405975040 Server Application ID: {3D14228D-FBE1-11D0-995D-00C04FD919C1} Server Application Name: IIS Out-Of-Process Pooled Applications This turned out to be…

  • Uncategorized

    Session_OnEnd not firing after applying Windows 2003 Service Pack 2

    We very recently discovered a bug in classic ASP (asp.dll) you get installing the Service Pack 2 for Windows 2003; removing the SP2 makes it work again as expected, so this is a regression bug introduced by the service pack itself. Basically with SP2 installed, the Session_OnEnd() method in classic ASP is not fired anymore, thus breaking all applications which rely on that event to run cleanup code. We already have some reports from customers, either directly to CSS or in Newsgroups. I know my colleagues are already well on this, a private fix has been produced and is being tested internally (as far as I know it works) and we are writing a KB article to document this. The process is still ongoing so I don’t have (and can’t give you) further details on this, but I guess it’s a matter of days before this will be publicly available; of course I’ll update this post when we’ll have the KB available. Update (03/04/2007)The KB article is still a draft and not public yet (should be released soon, anyway) but the fix is ready; you can get it calling CSS and ask for the hotfix #934903. Update (17/04/2007)The KB article has been published: http://support.microsoft.com/default.aspx?scid=kb;EN-US;934903  …