Click here to Skip to main content
15,069,297 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to call a javascript function of external file on onload or onsorted events of gridview in

thatraja 7-Nov-11 11:50am
You may follow below steps for this.

1) Add a reference of your External JavaScript file in your Aspx Page.
<script type="text/javascript" src="Scripts/MyJavascript.js"></script>

2) Use Load or/and Sorting Evetnts of your GridView to call your JavaScript function.

3) Call JavaScript function as below.
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "GridLoad", "<script type="text/javascript">Test()</script>");
thatraja 7-Nov-11 11:50am
All you need is some customization(by your own), here some examples for you.

Using JavaScript with ASP.Net GridView Control[^]
GridView Examples in ASP.NET 2.0 3.5[^]
GridView Examples[^]

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