Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET names forms inside user controls with an invalid name causing script error

Reply
Thread Tools

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

 
 
William D. Sossamon
Guest
Posts: n/a
 
      05-04-2004
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, http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing USER CONTROL which is inside Masterpagethrough Another USER Control inside normal page. Kiran More ASP .Net Web Controls 2 11-14-2006 12:58 PM
forms authentication -- expired forms cookie vs. not provided forms cookie Eric ASP .Net Security 2 01-27-2006 10:09 PM
child controls inside a user control inside a datalist Roman ASP .Net Web Controls 2 01-04-2005 07:07 AM
pulling or getting perl script name inside script J M Perl Misc 2 11-06-2004 03:16 AM
ASP.NET names forms inside user controls with an invalid name causing script error William D. Sossamon ASP .Net Web Controls 0 05-04-2004 03:04 PM



Advertisments