如何在使用“更新”面板时执行内容页面的JavaScript? [英] How to execute JavaScript of Content page while using Update panel ?

查看:50
本文介绍了如何在使用“更新”面板时执行内容页面的JavaScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在使用更新面板时执行内容页面JavaScript?



我对Update面板知之甚少!

How to execute JavaScript of Content page while using Update panel ?

I know very little about Update panel!

推荐答案

Hi Manzoor,



Javascript文件将在
Hi Manzoor,

Javascript files will be inside
<head> .... </head> 

使用这样的功能,以及PageLoad可以满足您的任何要求。



请参阅下面的示例代码。

use like this and the functionality insite the PageLoad can be anything as your require.

See the sample code below.

<head runat="server">
    <script type="text/javascript" language="javascript">
        function pageLoad(sender, args) {
            alert("Please enter your specific codes below...");
        }
    </script>
</head>


将jQuery代码放在pageLoad中,而不是
Place the jQuery code inside pageLoad instead of


(document)。 ready(),内部pageLoad在每次回发,同步或异步后执行。 pageLoad是ASP.NET AJAX中用于此目的的保留函数名。
(document).ready(), inside pageLoad is executed after every postback, synchronous or asynchronous. pageLoad is a reserved function name in ASP.NET AJAX that is for this purpose.


这篇关于如何在使用“更新”面板时执行内容页面的JavaScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆