1

UpdatePanel内にGridViewがあり、ページで検索が実行されたときに入力されます。値が入力されるか、ページが変更されると、フェードアニメーションが実行されます。UpdatePanelを更新するために実行したい他の操作がありますが、これらにこれらのフェードアニメーションを実行させたくありません。ASPフォーラムで私が見つけた最も近いものは次のとおりです:http://forums.asp.net/p/1037038/1487096.aspx

そのスレッドで提案されているソリューションの問題は、UpdatedイベントとUpdateingイベントをキャッチしてアニメーション化する方法がないことです。何か案は?

ありがとう、

ニック

4

2 に答える 2

1

さまざまな場所のコードを使用して、これに対する適切な解決策を見つけることができたので、この回答にいくつかのコードを追加したかっただけです。:) (一部は貼り付けられ、一部は編集されました。これの最終バージョンはテストされていませんが、そこからアイデアを得ることができるはずです!)

var postbackElement; // Global to store the control that initiated the postback

// Using JQuery here
$(document).ready(function()
{
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(pageLoaded);
});

function beginRequest(sender, args)
{
    postbackElement = args.get_postBackElement();

    // This method can be used to do animations in place of OnUpdating

    if(postbackElement.id == "YourControlId")
    {
      // or something like: if(id == "<%= YourControl.ClientID %>")

      // run your animation here
    }
}

function pageLoaded(sender, args)
{
    // This method can be used to do animations in place of OnUpdated

    // Also, the args variable holds a list of panels that are being updated;
    // I didn't use this though.

    // This condition is true on the first page load
    if (typeof(postbackElement) === "undefined")
    {
        return;
    }

    if(postbackElement.id == "YourControlId")
    {
      // run your animation here
    }
}
于 2009-02-03T21:39:16.557 に答える
1

ニック、

JQueryを使用してアニメーションを行うことを検討することは可能ですか? UpdatePanelAnimationExtender を使用するだけでなく、要素をより詳細に制御できる場合があります。

http://jquery.com/

http://docs.jquery.com/UI/Effects

于 2009-01-28T00:19:25.870 に答える