473,385 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

.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 1668
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: otto | last post by:
i need to read a variable in a javascript and translate it to a form in html the javascript variable is: <SCRIPT LANGUAGE='JavaScript'>RF2N('Total');</script> and i need to put that...
1
by: Jean-Luc Gyger | last post by:
Hello, I have on a html page an applet. A javascript function call one function of this applet. It works with IE but not with Mozilla or Netscape. I obtain the following error on the java-plugin...
3
by: John Telford | last post by:
I know this sound strange. I need is to convert a JavaScript Web site into HTML so Atomz <http://www.atomz.com/> can generate a search index for the site. Is there such a utility? ...John...
2
by: Lionel B | last post by:
System: Pentium 4, Win32, gcc 3.3.3 cygwin Does anyone know of a mechanism whereby C library functions can be made to throw a (C++) exception in case a call fails? This would obviate having to...
2
by: Hareth | last post by:
I created a context menu, linked to notifyicon. (a system tray menu). The menu pops up when u right click on it, in the system tray. (it works fine) When I delete some of the menuitems & rebuild...
2
by: decoy | last post by:
Hi all, Does anyone know whether it's possible for Java (signed) applets to call javascript functions and for javascript to call public methods in the applet code. I know that the latter is...
1
by: CADD | last post by:
I've used http://www.bloglines.com to add RSS feeds to my sites there and setup javascript in my website to search bloglines for the input term. The code below works perfect, but I have 1 minor...
1
by: 418928 | last post by:
Hi everybody, I would like to know if the way of communicating with an applet from Javascript is standard (valid for all web browsers). I know that JSObject (Applet->javascript) is not...
9
by: ajos | last post by:
hi all, im getting some problems in my javascript validations..... my jsp code--> 8: <head> 9: <title>Budget Master Administration</title> 10: <meta name="GENERATOR" content="Microsoft...
5
by: quirk | last post by:
I am trying to write a script where a page is populated with some maths questions, user answers them (it's timed but I've left this bit out), gets results on same page and ajax takes their score,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.