Click here to Skip to main content
15,558,089 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to apply sorting on gridview columns.i have master pages also in my application.

when i apply sorting on gridview without master page then it work fine but when i apply master page then sorting does not work.

<script type="text/javascript">
    $(document).ready(function pageLoad(sender, args) {

1 solution

In the master page put your scripts at the bottom, just before the end of the body tag and it should work. At the end of the day, your master and client pages combine to render one single HTML page.

Scripts at the bottom will fire when the page is loaded.
Share this answer
Milind Panchal 13-May-13 3:39am    
Not working. Each page I have 2 grid and have more than 100 pages. How can I call from master page
Mohammed Hameed 13-May-13 3:49am    
With a master page, all elements will have ct100__etc appended to the ID of the element. This is a feature since its a naming container. Typically, the way to work around it is to use syntax like:

$("#<%= button.ClientID %>").click(..);
Mohammed Hameed 13-May-13 3:51am    
u can just right click your page in browser and check the viewsource. Verify the rendered control names.

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