The bad 'return JavaScript' goes like this:
This is the action link that gets selected.
Ajax.ActionLink("Sign Out", "LogOff", "Account", new AjaxOptions { })
This is the action.
public ActionResult LogOff() { FormsAuth.SignOut(); return JavaScript("ClearDisplayName()"); }
The JavaScript is never called !
Additioinal Info:
All javascript functions are all in the .js file.
Four other actions, in the same file, do their return JavaScript(...)
successfully.
I tested the four working actions by doing a return JavaScript("ClearDisplayName()")
and
they all call ClearDisplayName()
successfully.
I tested the failing action by doing a return JavaScript("OtherKnownWorkingJava()")
with no luck.
Any idea's for this weird behavior ?
I noticed that all the successful actions pass through a View first. The troubled action does not, it comes directly from an ActionLink.