469,926 Members | 2,057 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

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

.NET Generates JavaScript errors for all my DataGrids all the sudden. HELP >>>>>>

Hi,

I had a portal that worked before, and over 5 months period JavaScript
errors started to show up on all forms where I have datagrids.

Using: IE 6.0, WIN XP, IIS 5.1, Framework 1.1

error: Expected ';'
The only JavaScript there is given to my by .NET:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["ZoneList:_ctl0"];
}
else {
theform = document.ZoneList:_ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

This is the datagrid:

<asp:DataGrid id="MyList" runat="server" width="55%"
BorderColor="#ffffff"
GridLines="none"
cellpadding="1"
cellspacing="0"
ItemStyle-CssClass="item"
HeaderStyle-ForeColor="white"
HeaderStyle-CssClass="GridHeader"
HeaderStyle-Height="19"
AlternatingItemStyle-CssClass="alternating"
AllowPaging="True"
OnPageIndexChanged="PageList"
PagerStyle-Mode="NumericPages"
PagerStyle-ForeColor="Black"
PagerStyle-HorizontalAlign="right"
PagerStyle-CssClass="pager"
PageSize="10"
AllowSorting="true"
OnSortCommand="SortCommand_OnClick"
AutoGenerateColumns="false"
DataKeyField="ZoneID">

<Columns>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:CheckBox id="Checkbox" Value="andy" runat="server" />
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:Label visible="false" id="ZoneID" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "ZoneID") %>' />
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Zone Name" SortExpression="ZoneName">
<ItemTemplate>
<a href="Zone_view.aspx?ZoneID=<%# DataBinder.Eval(Container.DataItem,
"ZoneID") %>" class="regLink"><%# DataBinder.Eval(Container.DataItem,
"ZoneName") %></a>
</ItemTemplate>
</asp:TemplateColumn>

<asp:BoundColumn HeaderText="Internal Name" DataField="ZoneInternalName"
SortExpression="ZoneInternalName"/>
<asp:BoundColumn HeaderText="Date Created" DataField="DateCreated"
SortExpression="DateCreated"/>

</Columns>
</asp:DataGrid>

Please let me know if you have seen anything like this before.
Nov 17 '05 #1
4 1551
"Andrzej Wegrzyn" <aw******@comcast.net> wrote in message
news:OL****************@TK2MSFTNGP10.phx.gbl...
Hi,

I had a portal that worked before, and over 5 months period JavaScript
errors started to show up on all forms where I have datagrids.

Using: IE 6.0, WIN XP, IIS 5.1, Framework 1.1

error: Expected ';'
The only JavaScript there is given to my by .NET:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["ZoneList:_ctl0"];
}
else {
theform = document.ZoneList:_ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>


Did you either just upgrade to Framework 1.1, or did you just start using
"ZoneList", or has "ZoneList" recently become a container for your <form
runat="server"> tag?

This is the infamous "colon in a form name" bug in Framework 1.1. It happens
whenever you get a server form somewhere inside of a control implementing
INamingContainer (like "ZoneList"). ASP.NET has always put colons in control
names to disambiguate them. The bug is that ASP.NET in 1.1 has begun trying
to use the form name as a variable name. That doesn't work with colons in
the name...

There is no good workaround for this. There are several bad ones, and I'm
sure someone will contribute them.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #2
"Andrzej Wegrzyn" <aw******@comcast.net> wrote in message
news:OL****************@TK2MSFTNGP10.phx.gbl...
Hi,

I had a portal that worked before, and over 5 months period JavaScript
errors started to show up on all forms where I have datagrids.

Using: IE 6.0, WIN XP, IIS 5.1, Framework 1.1

error: Expected ';'
The only JavaScript there is given to my by .NET:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf("n etscape") > -1) {
theform = document.forms["ZoneList:_ctl0"];
}
else {
theform = document.ZoneList:_ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>


Did you either just upgrade to Framework 1.1, or did you just start using
"ZoneList", or has "ZoneList" recently become a container for your <form
runat="server"> tag?

This is the infamous "colon in a form name" bug in Framework 1.1. It happens
whenever you get a server form somewhere inside of a control implementing
INamingContainer (like "ZoneList"). ASP.NET has always put colons in control
names to disambiguate them. The bug is that ASP.NET in 1.1 has begun trying
to use the form name as a variable name. That doesn't work with colons in
the name...

There is no good workaround for this. There are several bad ones, and I'm
sure someone will contribute them.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #3
Could you please post the HTML that is generated? I
suspect the anchor tag (<a href="Zone_view.aspx?
ZoneID ...) but I won't know until I can see the HTML.

Frank
-----Original Message-----
Hi,

I had a portal that worked before, and over 5 months period JavaScripterrors started to show up on all forms where I have datagrids.
Using: IE 6.0, WIN XP, IIS 5.1, Framework 1.1

error: Expected ';'
The only JavaScript there is given to my by .NET:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf ("netscape") > -1) { theform = document.forms["ZoneList:_ctl0"];
}
else {
theform = document.ZoneList:_ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split ("$").join(":"); theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

This is the datagrid:

<asp:DataGrid id="MyList" runat="server" width="55%"
BorderColor="#ffffff"
GridLines="none"
cellpadding="1"
cellspacing="0"
ItemStyle-CssClass="item"
HeaderStyle-ForeColor="white"
HeaderStyle-CssClass="GridHeader"
HeaderStyle-Height="19"
AlternatingItemStyle-CssClass="alternating"
AllowPaging="True"
OnPageIndexChanged="PageList"
PagerStyle-Mode="NumericPages"
PagerStyle-ForeColor="Black"
PagerStyle-HorizontalAlign="right"
PagerStyle-CssClass="pager"
PageSize="10"
AllowSorting="true"
OnSortCommand="SortCommand_OnClick"
AutoGenerateColumns="false"
DataKeyField="ZoneID">

<Columns>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:CheckBox id="Checkbox" Value="andy" runat="server" /></ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:Label visible="false" id="ZoneID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ZoneID") %>' />
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Zone Name" SortExpression="ZoneName"><ItemTemplate>
<a href="Zone_view.aspx?ZoneID=<%# DataBinder.Eval (Container.DataItem,"ZoneID") %>" class="regLink"><%# DataBinder.Eval (Container.DataItem,"ZoneName") %></a>
</ItemTemplate>
</asp:TemplateColumn>

<asp:BoundColumn HeaderText="Internal Name" DataField="ZoneInternalName"SortExpression="ZoneInternalName"/>
<asp:BoundColumn HeaderText="Date Created" DataField="DateCreated"SortExpression="DateCreated"/>

</Columns>
</asp:DataGrid>

Please let me know if you have seen anything like this before.

.

Nov 17 '05 #4
Could you please post the HTML that is generated? I
suspect the anchor tag (<a href="Zone_view.aspx?
ZoneID ...) but I won't know until I can see the HTML.

Frank
-----Original Message-----
Hi,

I had a portal that worked before, and over 5 months period JavaScripterrors started to show up on all forms where I have datagrids.
Using: IE 6.0, WIN XP, IIS 5.1, Framework 1.1

error: Expected ';'
The only JavaScript there is given to my by .NET:

<script language="javascript">
<!--
function __doPostBack(eventTarget, eventArgument) {
var theform;
if (window.navigator.appName.toLowerCase().indexOf ("netscape") > -1) { theform = document.forms["ZoneList:_ctl0"];
}
else {
theform = document.ZoneList:_ctl0;
}
theform.__EVENTTARGET.value = eventTarget.split ("$").join(":"); theform.__EVENTARGUMENT.value = eventArgument;
theform.submit();
}
// -->
</script>

This is the datagrid:

<asp:DataGrid id="MyList" runat="server" width="55%"
BorderColor="#ffffff"
GridLines="none"
cellpadding="1"
cellspacing="0"
ItemStyle-CssClass="item"
HeaderStyle-ForeColor="white"
HeaderStyle-CssClass="GridHeader"
HeaderStyle-Height="19"
AlternatingItemStyle-CssClass="alternating"
AllowPaging="True"
OnPageIndexChanged="PageList"
PagerStyle-Mode="NumericPages"
PagerStyle-ForeColor="Black"
PagerStyle-HorizontalAlign="right"
PagerStyle-CssClass="pager"
PageSize="10"
AllowSorting="true"
OnSortCommand="SortCommand_OnClick"
AutoGenerateColumns="false"
DataKeyField="ZoneID">

<Columns>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:CheckBox id="Checkbox" Value="andy" runat="server" /></ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="">
<ItemTemplate>
<asp:Label visible="false" id="ZoneID" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ZoneID") %>' />
</ItemTemplate>
</asp:TemplateColumn>

<asp:TemplateColumn HeaderText="Zone Name" SortExpression="ZoneName"><ItemTemplate>
<a href="Zone_view.aspx?ZoneID=<%# DataBinder.Eval (Container.DataItem,"ZoneID") %>" class="regLink"><%# DataBinder.Eval (Container.DataItem,"ZoneName") %></a>
</ItemTemplate>
</asp:TemplateColumn>

<asp:BoundColumn HeaderText="Internal Name" DataField="ZoneInternalName"SortExpression="ZoneInternalName"/>
<asp:BoundColumn HeaderText="Date Created" DataField="DateCreated"SortExpression="DateCreated"/>

</Columns>
</asp:DataGrid>

Please let me know if you have seen anything like this before.

.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by otto | last post: by
1 post views Thread by Jean-Luc Gyger | last post: by
3 posts views Thread by John Telford | last post: by
2 posts views Thread by Lionel B | last post: by
2 posts views Thread by Hareth | last post: by
2 posts views Thread by decoy | last post: by
1 post views Thread by CADD | last post: by
1 post views Thread by 418928 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.