0
我該如何獲得在add_endRequest中導致回發的元素的id?
例如
//線的那端傳進程,如何在endRequest方法中獲取源元素ID?
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(requestComplete_Handler)
//will be called after the async request completes.
function requestComplete_Handler(sender, args)
{
var panel = sender._postBackSettings.sourceElement.id;
switch (panel)
{
case "<%=upSubAccount.ClientID %>":
__doPostBack('<%=upAllocationChart.ClientID%>');
break;
case "<%=upAllocationChart.ClientID%>" :
__doPostBack('<%=upTotal.ClientID %>');
break;
}
}
雖然這個工作,但
sender._postBackSettings.sourceElement.id;
由於沒有每次。
感謝Buddy爲您提供快速幫助。 – 2013-03-26 05:44:25
不客氣! :-) – nunespascal 2013-03-26 05:51:41
嗨帕斯卡,
您的建議代碼工作完美我是同一頁面,但是當我導航到不同的頁面時,它顯示HTTP錯誤404.0 - 未找到 您正在查找的資源已被刪除,名稱已更改,或者暫時不可用。 – 2013-03-26 06:22:47