`I just spent about 3 hours trying to fix this error with the LoginStatus control. The control updates fine when I log in, but when I click the “Logout” link on the LoginStatus control I wasn’t getting a postback. After a little more looking I noticed I was getting a javascript error whenever I clicked Logout. The error I was getting was “TheForm is undefined”. I googled and googled and googled and ultimately I didn’t find the fix for my problem on google but I did find a lot of different solutions to the problem. I am consolidating them with the solution for me all in one place so that hopefully noone else has to go through this.
Scenario 1
Make sure when including external Javascript files like so:
[code lang='html']
[/code]
Scenario 2
The script created by Asp.Net references your form by id. Make sure your form id matches what is shown in the javascript generated. For instance mine had to be named Aspnetform so I made sure it looked like:
[code lang='html']
[/code]
This will not work. Swap the order of your tags to be thusly:
[code lang='html']
[/code]
Hope this helps someone else.
