473,513 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.net Javascript Error htmlfile: not implemented

Hi. I'm relatively new to asp.net and very new to javascript. I'm
attempting to modify table cells after my page has loaded. Here is the
javascript code within my asp.net page which runs OnLoad:

<script language="javascript">
function ShowGridHeader()
{
if (typeof grdData == "undefined")
{
alert("undefined")
}
else
{
alert("defined")
var rgWidths = new Array();
------> tblDataHeader.rows[0].cells.length =
grdData.rows[0].cells.length;
for (var i = 0; i < grdData.rows[0].cells.length; i++)
{
tblDataHeader.rows[0].cells[i] = grdData.rows[0].cells[i];
rgWidths[i] = grdData.rows[0].cells[i].offsetWidth;
}
}
}
</script>

I'm getting an "htmlfile: not implemented" error. It gives me the
alert box and then fails on the line I indicated with an arrow. I have
been unable to find any documentation of this error. Anyone have any
suggestions?

Thanks,
D

Nov 19 '05 #1
5 1655
Are you using RegisterStartupScript
or RegisterClientScriptBlock ?

Juan T. Llibre
ASP.NET MVP
===========
<da******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hi. I'm relatively new to asp.net and very new to javascript. I'm
attempting to modify table cells after my page has loaded. Here is the
javascript code within my asp.net page which runs OnLoad:

<script language="javascript">
function ShowGridHeader()
{
if (typeof grdData == "undefined")
{
alert("undefined")
}
else
{
alert("defined")
var rgWidths = new Array();
------> tblDataHeader.rows[0].cells.length =
grdData.rows[0].cells.length;
for (var i = 0; i < grdData.rows[0].cells.length; i++)
{
tblDataHeader.rows[0].cells[i] = grdData.rows[0].cells[i];
rgWidths[i] = grdData.rows[0].cells[i].offsetWidth;
}
}
}
</script>

I'm getting an "htmlfile: not implemented" error. It gives me the
alert box and then fails on the line I indicated with an arrow. I have
been unable to find any documentation of this error. Anyone have any
suggestions?

Thanks,
D

Nov 19 '05 #2
No, I'm not. I will look into they're usage, as I am not familiar with
them. Thanks.

Nov 19 '05 #3
If by not using RegisterStartupScript
or RegisterClientScriptBlock would it execute my script at all? It
starts to execute the scripts gives a run-time error when I try to set
...cells.length.

Nov 19 '05 #4
da******@yahoo.com wrote:
Hi. I'm relatively new to asp.net and very new to javascript. I'm
attempting to modify table cells after my page has loaded.
Then ASP is irrelevant. Just discuss the code at the client, how you
generate it at the server is for some other forum.
Here is the
javascript code within my asp.net page which runs OnLoad:

<script language="javascript">
language has been depreciated, use:

<script type="text/javascript">
function ShowGridHeader()
{
if (typeof grdData == "undefined")
{
alert("undefined")
}
This script does not define grdData anywhere, so it is undefined. Your
script will stop execution right there - at least that is what the
code instructs the browser to do and what both IE and Firefox did for
me.
else
{
alert("defined")
var rgWidths = new Array();
------> tblDataHeader.rows[0].cells.length =
grdData.rows[0].cells.length;


You can't set 'length'. It's like telling a tree how many apples
it has. ...cells.length will return the number of cells in a row (IE
will also return the number of cells in a table if asked), are you
trying to use it to tell the row to create that number of cells?

If so, this is not how to do it. Learn about document.createElement.

Where have you defined "tblDataHeader"? It seems to be a reference to
a table header (thead) element, but ... ?

To get a reference to an HTML element, give it an id, then get a
reference to it. Suppose your HTML looks like:

<table id="tblDataTable">
<thead id="tblDataHeader">
<tr onclick="alert(this.cells.length);">
<td>blah1</td>
<td>blah2</td>
</tr>
</thead>
<tbody>
<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
</tbody>
</table>

You can get a reference to the thead by:

var tbleDataHeader;
if ( document.getElementById ) {
tbleDataHeader = document.getElementById('tblDataHeader')
} else if (document.all) {
tbleDataHeader = document.all['tblDataHeader'];
}

If you are trying to create an element (say a table element), use:

var elementRef = document.createElement('table');

I think it would be best if you say what you are trying to achieve,
since your script is pretty broken it's impossible to tell what you are
trying to do.
--
Rob
Nov 19 '05 #5
All objects are declared elsewhere. In the debugger I can see the
values of all objects listed, so I know that is not my problem. What
I'm trying to do is dynamically format the tblDataHeader table. I was
attempting to set the length in order to set the number of columns in
the table. The ultimate goal here is to get a data grid with a
scrollable detail and fixed headers. Thanks.

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
2522
by: Andy Fish | last post by:
Hi, I want to use an anchor tag to invoke some javascript and I've read that it's bad form to use <a href="javascript:foo()"> I've read endless usenet posts and hint sites on the net, they all...
5
7146
by: damonl73 | last post by:
Hi. I'm relatively new to asp.net and very new to javascript. I'm attempting to modify table cells after my page has loaded. Here is the javascript code within my asp.net page which runs OnLoad:...
1
1456
by: Priya | last post by:
I have enabled smart navigation for my ASP.Net web application. It works fine except for some of my pages where I'm using some Javascript code to open a page in a new window on a button click....
2
2033
by: Allerdyce.John | last post by:
I have this python code: print >> htmlFile, "<div id=\"track" + unicode(1) + "\" style=\"width: 200px; height:18px;\">"; But that caues this error, and I can't figure it out why. Any help is...
0
7265
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
7171
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
7545
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...
0
5692
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5095
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3240
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
461
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.