Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.net Javascript Error htmlfile: not implemented

Reply
Thread Tools

ASP.net Javascript Error htmlfile: not implemented

 
 
damonl73@yahoo.com
Guest
Posts: n/a
 
      01-12-2005
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

 
Reply With Quote
 
 
 
 
Juan T. Llibre
Guest
Posts: n/a
 
      01-12-2005
Are you using RegisterStartupScript
or RegisterClientScriptBlock ?



Juan T. Llibre
ASP.NET MVP
===========
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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
>



 
Reply With Quote
 
 
 
 
damonl73@yahoo.com
Guest
Posts: n/a
 
      01-12-2005
No, I'm not. I will look into they're usage, as I am not familiar with
them. Thanks.

 
Reply With Quote
 
damonl73@yahoo.com
Guest
Posts: n/a
 
      01-12-2005
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.

 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      01-13-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) 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
 
Reply With Quote
 
damonl73@yahoo.com
Guest
Posts: n/a
 
      01-13-2005
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.

 
Reply With Quote
 
tom_tregenna tom_tregenna is offline
Junior Member
Join Date: May 2008
Posts: 1
 
      05-02-2008
damonl73,

From what I understand of your issue, I had a similar problem when attempting to call a local function from a Web Service callback handler, such that the following code (which gets some data from a Web Service before allowing a drag'n'drop operation) would produce the error you mention:

function ServiceCallSucceeded(response, userContext, methodName) {
if (methodName == "ObjectClicked") {
document.onmousemove = DragObject(userContext);
document.onmouseup = DropObject(userContext);
}
}

In my case, the resolution to this issue was to encapsulate the function calls in new inline functions as follows:

function ServiceCallSucceeded(response, userContext, methodName) {
if (methodName == "ObjectClicked") {
document.onmousemove = function() { DragObject(userContext); }
document.onmouseup = function() { DropObject(userContext); }
}
}

The callback handler is now able to call local functions 'DragObject' and 'DropObject' without producing the 'htmlfile: not implemented' error.

I hope this helps someone, even though this thread is 3 years old!

- T
 
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
crystal report issue in VS2005 - Not implemented Details: Error Code:0x Sorce: ADODB.CONNECTION msnews.microsoft.com ASP .Net 2 10-09-2007 08:18 PM
Screen Scraping Error: (501) Not Implemented aferriere ASP .Net 2 02-14-2007 12:49 AM
Scrren Scraping Error: 501 Not Implemented aferriere ASP .Net 1 02-14-2007 12:20 AM
Error while trying to run project: Unable to start debugging on the webserver not implemented logan ASP .Net 1 10-18-2005 08:30 PM
ASP.net Javascript Error htmlfile: not implemented damonl73@yahoo.com Javascript 5 01-13-2005 03:33 PM



Advertisments