Creating a small web app using ASP.NET has been going smoothly, until I encountered an issue with LinkButton controls after adding Google Analytics code to one of my pages. Every time I click on a link button, I receive this error message:
Microsoft JScript runtime error: The value of the property '__doPostBack' is null or undefined, not a Function or object
All other links and controls on the page are working fine except for the LinkButtons. Removing the Google Analytics script resolves the problem, leading me to believe there is some conflict between the script and the LinkButton controls triggering postbacks on the page.
LATEST UPDATE. Further analysis revealed that without the Google Analytics script reference, the HTML generated by ASP.NET appears normal:
However, when the Google Analytics code is included, the structure of the HTML becomes distorted:
Take a look at that form tag placement! It seems that the postback error is attributed to the LinkButton controls being positioned outside the ASP.NET form. But why? END OF UPDATE.
If you have any suggestions on how to resolve this issue, I would greatly appreciate it. Thank you.
FINAL UPDATE. Through extensive troubleshooting, I was able to identify a solution on my own. I have shared my findings in a response below. Appreciation to all who contributed answers here. END OF UPDATES.