나는 그것을 얻었습니다! Og for strange foreign language blogs
수정하려면 ASP.NET AJAX 클라이언트 측 프레임 워크가 Server.Transfer() 호출의 실제 대상에서 직접 부분 요청을 직접 지시 할 수 있습니다. 나는 가능한 부작용이 무섭다. (인프라가 목적을 가지고 있음을 알고있다.)하지만 지금까지는 잘 작동하고있는 것 같다. 여기
내 페이지의 Load 이벤트에서 호출 된 문제를 해결하는 방법입니다 :
///
/// Adds to the page a JavaScript that corrects the misbehavior of AJAX when a page is target of a Server.Transfer call.
///
protected void AjaxUrlBugCorrection()
{
string actualFile = Server.MapPath(AppRelativeVirtualPath);
string redirectFile = Server.MapPath(Context.Request.FilePath);
string baseSiteVirtualPath = HttpRuntime.AppDomainAppVirtualPath;
if (actualFile != redirectFile)
{
System.Text.StringBuilder sbJS = new System.Text.StringBuilder();
string actionUrl = string.Format("'{0}'", baseSiteVirtualPath + AppRelativeVirtualPath.Replace("~", String.Empty));
sbJS.Append("Sys.Application.add_load(function(){");
sbJS.Append(" var form = Sys.WebForms.PageRequestManager.getInstance()._form;");
sbJS.Append(" form._initialAction = " + actionUrl + ";");
sbJS.Append(" form.action = " + actionUrl + ";");
sbJS.Append("});");
ClientScript.RegisterStartupScript(this.GetType(), "CorrecaoAjax", sbJS.ToString(), true);
}
}
샌더는 aspx 코드를 게시 할 수 있습니다. –
aspx 변경 사항이 없습니다. Page_Load에서이 메서드를 호출하면 페이지의 모든 UpdatePanels이 작동하기 시작합니다. – Sander