Click here to Skip to main content
16,018,805 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
How to execute JavaScript of Content page while using Update panel ?

I know very little about Update panel!
Posted

Hi Manzoor,

Javascript files will be inside
<head> .... </head> 
use like this and the functionality insite the PageLoad can be anything as your require.

See the sample code below.
XML
<head runat="server">
    <script type="text/javascript" language="javascript">
        function pageLoad(sender, args) {
            alert("Please enter your specific codes below...");
        }
    </script>
</head>
 
Share this answer
 
v2
Comments
Zafar Sultan 31-Oct-13 2:03am    
You shouldn't post your comment as a solution. There is an "Improve Solution" button to update your posted solution. For commenting on the OP's comment, you can use "Reply" link.
[no name] 31-Oct-13 2:13am    
Thanks.
Place the jQuery code inside pageLoad instead of $(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. $(document).ready() on the other hand, is executed only once, when the DOM is initially ready/loaded.

C#
function pageLoad(sender, args) {
    ...
}




XML
Javascript files will be inside
 Collapse | Copy Code
<head> .... </head> use like this and the functionality insite the PageLoad can be anything as your require.

See the sample code below.

 Collapse | Copy Code
<head runat="server">
    <script type="text/javascript" language="javascript">
        function pageLoad(sender, args) {
            alert("Please enter your specific codes below...");
        }
    </script>
</head>
 
Share this answer
 
v2
Comments
Manzoor Ahmed P 30-Oct-13 7:17am    
Sorry, I am totally new... Can u tell me where to put this ? in head section or in the body section of content page or master page?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900