Hello,
I made some changes to my ajax test website and now my Ajax.ActionLinks don't work anymore! The ActionLinks in question are made like this:
<%=Ajax.ActionLink("Language Select", "LanguageScreen", "Home", from("LanguageScreen", "Functions"), meep("LanguageScreen", "Functions"))%>`
The "from" and "meep" functions are only one liners as follows:
Function meep(ByVal act As String, ByVal cnt As String) As AjaxOptions
Return New AjaxOptions With {.UpdateTargetId = "Content", .OnSuccess = "Hash('" + act + "', '" + cnt + "')", .LoadingElementId = "Loader", .OnComplete = "HideLoader", .OnBegin = "EmptyContent('" + act + "', '" + cnt + "')"}
End Function
Function from(ByVal act As String, ByVal cnt As String)
Return New With {.fromAct = act, .fromCnt = cnt}
End Function
When I click said button, Hash() executes okay
function Hash(ghz, ghzz) {
set_action(ghz);
set_controller(ghzz);
window.location.hash = "#" + ghz + "." + ghzz;
}
EmptyContent also works:
function EmptyContent(ghz, ghzz) {
document.getElementById("Loader").style.visibility = "visible";
document.getElementById("main").style.backgroundColor = "#a0a0a0";
document.body.style.backgroundColor = "#3c6792";
return true;
}
But then the process stucks somewhere. HideLoader() does not get called.
This is the error thrown, including stack:
Uncaught exception:TypeError: 'b.apply' is not a function
Error thrown at line 5, column 583 in <anonymous function: Function.createDelegate>() in http://ajax.sinni800.ath.cx/Scripts/MicrosoftAjax.js:return b.apply(a,arguments)
called from line 15, column 1073 in <anonymous function: Sys.Mvc.MvcHelpers.$2>($p0, $p1, $p2, $p3, $p4) in http://ajax.sinni800.ath.cx/Scripts/MicrosoftMvcAjax.js:$7=$p4.onBegin($6)!==false;
called from line 11, column 124 in <anonymous function: Sys.Mvc.AsyncHyperlink.handleClick>(anchor, evt, ajaxOptions) in http://ajax.sinni800.ath.cx/Scripts/MicrosoftMvcAjax.js:Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);
called from line 1, column 0 in <anonymous function>(event):Sys.Mvc.AsyncHyperlink.handleClick(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, loadingElementId: 'Loader', updateTargetId: 'Content', onBegin: Function.createDelegate(this, EmptyContent("Mine", "Home")), onComplete: Function.createDelegate(this, HideLoader()), onSuccess: Function.createDelegate(this, Hash("Mine", "Home")) });
If you want, please search through my website if you find anything suspicious. I already looked if I defined b somewhere, but nothing.
This is the URL: http://ajax.sinni800.ath.cx/ . It listens to hashes, for example: http://ajax.sinni800.ath.cx/#Mine.Home This is in the format Action.Controller. Another one: #Mines.Home.
I hope somebody finds this.