开发者

ScriptManagerProxy, UpdatePanel and pure JS

<asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <asp:UpdatePanel ID="upSchedule" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
        <ContentTemplate>
            <script type="text/javascript">
                function afterRender(data) {
                // code
                }
            </script>
            <div style="margin-bottom:5px">
                Izberi:&nbsp;
                <a href="javascript:dpc1.commandCallBack('previous');">Predhodnji teden</a> -
                <a href="javascript:dpc1.commandCallBack('next');">Nas开发者_高级运维lednji teden</a> -
                <a href="javascript:dpc1.commandCallBack('today');">Danes</a> -
                <a href="javascript:dpc1.commandCallBack('week');">Začetek tedna</a>
            </div>
            <br />
            <table style="width:100%">
                <tr>
                    <td valign="top" style="width:150px">
                        <DayPilot:DayPilotNavigator ID="dpnOrders" runat="server" 
                            BoundDayPilotID="dpcOrders" 

i need to call pure JS inside UpdatePanel becouse of DayPilotPro but when i am using UpdatePanel this is not possible. How can i call it?


Yes this will work. But make sure that the script is placed below the ScriptManager.

   Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequestHandler); 
                   Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
                        //Before callback event handler
                        function BeginRequestHandler(sender, args) {

                        }
                        //After callback event handler
                        function EndRequestHandler(sender, args) {

                        }


you write

 prm = Sys.WebForms.PageRequestManager.getInstance();

 prm.add_pageLoaded(loadData)

 prm.add_beginRequest(afterRender)


    function loadData(sender,args)
    {

    }

    function afterRender(sender, args)
    {

    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜