1

我对我的 ajax 测试网站进行了一些更改,现在我的 Ajax.ActionLinks 不再工作了!有问题的 ActionLink 是这样制作的:

<%=Ajax.ActionLink("LanguageScreen", "LanguageScreen", "Home", from("LanguageScreen", "Functions"), meep("LanguageScreen", "Functions"))%>`

"from" 和 "meep" 函数只是其中之一,如下所示:

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

当我单击所述按钮时, Hash() 执行正常

    function Hash(ghz, ghzz) {
        set_action(ghz);
        set_controller(ghzz);
        window.location.hash = "#" + ghz + "." + ghzz;
    }

EmptyContent 也可以:

    function EmptyContent(ghz, ghzz) {
        document.getElementById("Loader").style.visibility = "visible";
        document.getElementById("main").style.backgroundColor = "#a0a0a0";
        document.body.style.backgroundColor = "#3c6792";
        return true;
    }

但随后该过程卡在某个地方。HideLoader() 不会被调用。

这是抛出的错误,包括堆栈:

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")) });

如果你愿意,如果你发现任何可疑的东西,请通过我的网站搜索。如果我在某处定义了 b,我已经看过了,但什么也没有。

这是 URL:http ://ajax.sinni800.ath.cx/ 。它侦听哈希,例如:http://ajax.sinni800.ath.cx/#Mine.Home这是 Action.Controller 的格式。另一个:#Mines.Home。

我希望有人能找到这个。

4

0 回答 0