467,207 Members | 1,288 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,207 developers. It's quick & easy.

ASP.NET names forms inside user controls with an invalid name causing script error

http://support.microsoft.com/default.aspx?kbid=818803

1.. You add the following form to a user control:
<form id="Form1" name="Form1" runat="server">2.. You add the user control,
for example, Workspace1, to a page. When you do this, an auto-generated
script that is 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 the form name contains a colon as a delimiter.

Another example of the problem in the automatically generated script for a
__doPostBack function is the following:
function __doPostBack(eventTarget, eventArgument)
{
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -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;
I cannot find a patch or work around for this issue other than contacting
PSS, can anyone help me with this? Any additional information would be
greatly appreciated.William D. SossamonMCP, MV*****@webgenetic.com
Nov 18 '05 #1
  • viewed: 899
Share:

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Andres Eduardo Hernando | last post: by
3 posts views Thread by Kris van der Mast | last post: by
6 posts views Thread by Manny Chohan | last post: by
3 posts views Thread by Geraldine Hobley | last post: by
21 posts views Thread by Dan Tallent | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.