나는이 문제에 도움이 필요 :업데이트 ASP.NET 패널은 비동기 적으로
상황 : 나는 (SharePoint의) UserControl이있어 쿼리 문자열을 읽고 비동기 이벤트와 그것을 처리합니다. 바쁜 동안에는 회 전자가 표시됩니다. 이벤트가 종료 된 후, UserControl을 내부의 updatepanel은
코드를 업데이트하고 메시지를 표시 (+ 스피너를 숨기기)해야 나는 UserControl_Unload 이벤트를 비동기라고하는 기능을 가지고있다.
private delegate void AsyncFunction(string activation);
void UserControl_Unload(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
AsyncFunction dlgt = new AsyncFunction(this.CheckUrl);
AsyncCallback callback = new AsyncCallback(FunctionCallBack);
IAsyncResult ar = dlgt.BeginInvoke(activationcode, callback, null);
}
}
private void CheckUrl(string lalala)
{
// Some code
}
사용자 제어 태그 :
<asp:UpdatePanel runat="server" id="pnlContent" updatemode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:UpdatePanel runat="server" id="pnlStatus" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<asp:Label runat="server" ID="lblMessage" />
<asp:LinkButton runat="server" ID="btnHome" Text="Terug naar welkom-pagina" PostBackUrl="<% $SPUrl:~sitecollection %>" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" id="pnlGegevens" UpdateMode="Conditional" ChildrenAsTriggers="false">
<ContentTemplate>
<div><asp:Image runat="server" ID="imgLoading" AlternateText="Loading..." CssClass="gb_pl_loadingImage" ImageUrl="<% $SPUrl:~sitecollection/Style Library/GB-VW Styles/Images/ajax-loader.gif %>"/></div>
<div class="gb_pl_loading">Even geduld aub. De gebruiker wordt geactiveerd...</div>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</asp:UpdatePanel>
이 모두 잘 작동하지만 패널을 업데이트해야 할 때, 그것은 작동하지 않습니다.
private void FunctionCallBack(IAsyncResult test)
{
pnlContent.Update()
}
해결 방법을 알고있는 사람은 누구입니까? (가능하면 asp, C# 또는 자바 스크립트 만 사용 가능)
아무도 모른다. ??? 도와주세요, 정말 급한 일입니다! – RubenHerman