I use ASP.NET to create a small web application. One of my pages includes some LinkButton controls that worked fine until I added a link to the Google Analytics code . Now, when I click the link button, I get an error message:
Microsoft JScript runtime error: '__doPostBack' property value is null or undefined, not a function or object
Other links and controls on the page work fine. If I remove the link to the Google Analytics script from the page, everything will be fine. It seems that the problem is due to the interaction between the Google Analytics script and LinkButton controls that are trying to bring the page back.
UPDATE I also noticed the following. If the Google Analytics script link is missing, the HTML generated by ASP.NET looks fine:

However, as soon as I add the Google Analytics code, the HTML twists:

Verify that the form tag! Now I assume that the opposite error occurs because the linkbutton controls are located outside the ASP.NET form. But why? END UPDATE .
Any ideas on how to solve this? Thanks.
ADDITIONAL UPDATE . After much experimentation, I was able to solve this myself. I added the answer below, showing my findings. Thanks to everyone who posted the answers here. END UPDATE .
source share