473,672 Members | 2,381 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="javas cript">
function ShowGridHeader( )
{
if (typeof grdData == "undefined" )
{
alert("undefine d")
}
else
{
alert("defined" )
var rgWidths = new Array();
------> tblDataHeader.r ows[0].cells.length =
grdData.rows[0].cells.length;
for (var i = 0; i < grdData.rows[0].cells.length; i++)
{
tblDataHeader.r ows[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

Jul 23 '05 #1
5 7149
Are you using RegisterStartup Script
or RegisterClientS criptBlock ?

Juan T. Llibre
ASP.NET MVP
===========
<da******@yahoo .com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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="javas cript">
function ShowGridHeader( )
{
if (typeof grdData == "undefined" )
{
alert("undefine d")
}
else
{
alert("defined" )
var rgWidths = new Array();
------> tblDataHeader.r ows[0].cells.length =
grdData.rows[0].cells.length;
for (var i = 0; i < grdData.rows[0].cells.length; i++)
{
tblDataHeader.r ows[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

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

Jul 23 '05 #3
If by not using RegisterStartup Script
or RegisterClientS criptBlock 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 .

Jul 23 '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="javas cript">
language has been depreciated, use:

<script type="text/javascript">
function ShowGridHeader( )
{
if (typeof grdData == "undefined" )
{
alert("undefine d")
}
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.r ows[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.create Element.

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="tblDataTabl e">
<thead id="tblDataHead er">
<tr onclick="alert( this.cells.leng th);">
<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.getEle mentById ) {
tbleDataHeader = document.getEle mentById('tblDa taHeader')
} else if (document.all) {
tbleDataHeader = document.all['tblDataHeader'];
}

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

var elementRef = document.create Element('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
Jul 23 '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.

Jul 23 '05 #6

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

Similar topics

6
2529
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 suggest different things and I can't get any kind of consistency, and I can't find any solution that works properly for IE, opera and mozilla. many of the recommended solutions go something like this:
1
1462
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. Here is a sample Javascript code which I'm using Response.Write("<script language='javascript'>") Response.Write("window.open('POREP01.aspx')") Response.Write("</script") Response.Write(">")
5
1660
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: <script language="javascript"> function ShowGridHeader() { if (typeof grdData == "undefined") { alert("undefined")
2
2041
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 appreicate File "./run.py", line 193, in ? print >> htmlFile, "<div id=\"track" + unicode(1) + "\" style=\"width: 200px; height:18px;\">";
0
8488
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8932
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8686
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7449
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4230
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2821
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 we have to send another system
2
2071
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1821
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.