Pages creating onclick="return TABLE1_onclick()" causing javascript errors

  • Thread starter Thread starter Dennis
  • Start date Start date
D

Dennis

For some reason the HTML that is being created by my ASP.Net pages
(2.0) have a table like this:

<table border="0" cellpadding="0" cellspacing="0" style="z-index: 103;
left: 0px; width: 100%; position: absolute; top: 0px;" id="TABLE1"
onclick="return TABLE1_onclick()">

This ends up causing a javascript error "Object excpected" when you
click on the page because there is no TABLE1_onclick() function. Why
is it doing this and what can I do to get it to stop? I'm not doing
anything esoteric, just creating simple pages using a master page.

Thanks,
Dennis
 
I thought if I create a TABLE1_onclick function that does nothing it
would stop the error. So I put one at the top of my ASP page.
However, when the page is created for the browser, the function endd up
being below the table tag that calls it, so it can't find it. If I
manually modify the html and put the function above the tag, the error
goes away. If there isn't any way to get rid of the call, is there a
way I can have the javascript function rendered above the tag?
 
Back
Top