FIX: Form Inside of a User Control Generates a Script Error

This article has been archived. It is offered "as is" and will no longer be updated.
Note If you are experiencing this problem in the Microsoft .NET Framework 1.1, click the following article number to view the article in the Microsoft Knowledge Base:
818803 INFO: Post-RTM .NET Framework 1.1 ASP.NET Hotfix Package Symptoms
When the following conditions exist, you may receive a client-side script error in Netscape or in Microsoft Internet Explorer:
  1. You add the folowing form to a user control:
    <form id="Form1"		  name="Form1" runat="server">
  2. You add the user control, for example, Workspace1, to a page.
An auto-generated script similar to the following script is added to the page:
<form name="Workspace1:Form1"		  method="post" action="formtest2.aspx" id="Workspace1_Form1">

The script error occurs because the form name and the form ID are different, and because the form name contains a colon.

Another example of the problem in the auto-generated script for a __doPostBack function follows:
function		  __doPostBack(eventTarget, eventArgument) {  var theform; if		  (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) { 		  theform = document.forms["_ctl14:Form1"]; } else {  theform =		  document._ctl14:Form1; } theform.__EVENTTARGET.value =		  eventTarget.split("$").join(":"); theform.__EVENTARGUMENT.value =		  eventArgument; theform.submit(); 

Notice that the Form has a uniqueID property that contains a colon in the following lines:
theform =		  document.forms["_ctl14:Form1"];  theform = document._ctl14:Form1; 
ASP.NET replaces the colon with an underscore ( _ ) character to address the problem.
To resolve this problem, obtain Microsoft ASP.NET Hotfix Rollup package. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
818058 INFO: ASP.NET Hotfix Rollup
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem. This fix may receive additional testing. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next .NET Framework service pack that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The typical support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
 Date         Time  Version               Size  File name----------------------------------------------------------------03-Apr-2003  18:31  1.0.3705.419      196,608  Aspnet_isapi.dll03-Apr-2003  18:26                      4,169  Aspnet_perf.h03-Apr-2003  18:26                     20,468  Aspnet_perf.ini03-Apr-2003  18:26                     20,342  Aspnet_perf2.ini03-Apr-2003  18:31  1.0.3705.419       24,576  Aspnet_regiis.exe03-Apr-2003  18:31  1.0.3705.419       28,672  Aspnet_wp.exe03-Apr-2003  17:31  1.0.3705.419       69,632  Corperfmonext.dll03-Apr-2003  17:29  1.0.3705.419      303,104  Mscorjit.dll04-Apr-2003  06:20  1.0.3705.419    1,953,792  Mscorlib.dll03-Apr-2003  17:22                     10,284  Mscorlib.ldo03-Apr-2003  17:30  1.0.3705.419    2,269,184  Mscorsvr.dll03-Apr-2003  17:30  1.0.3705.419    2,269,184  Mscorwks.dll22-Aug-2002  19:23                         15  Smartnav.htm22-Oct-2002  13:41                      8,728  Smartnav.js04-Apr-2003  06:25  1.0.3705.419    1,191,936  System.web.dll					NOTE: This hotfix is part of a hotfix rollup:KBLink:818058.KB.EN-US: FIX: ASP.NET Hotfix Rollup Includes: 818537,	818058, 816829 & 817779				

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Article ID: 817779 - Last Review: 02/27/2014 18:43:39 - Revision: 1.9

Microsoft .NET Framework 1.0, Microsoft ASP.NET 1.0

  • kbnosurvey kbarchive kbhotfixserver kbqfe kbnetframe100presp3fix kbfix kbbug KB817779