tags:

views:

13

answers:

1

I have an updatepanel. Inside that i have some controls for selecting search criteria. For search button onclientclick iam calling javascript functon for validation and in onclick iam calling the mathod to populate the gridview. On clicking search first time it is not loading the grid and clicking the second time it populates.

A: 

Remove from the updatePanel your code and checks for errors on the first click, then place it again.

Its probably have to do with your viewstate that is not populate correctly so your first click gets an error that you do not see because of your updatePanel.

Aristos
I cant remove updatepanel, since iam updating the panel in many places
Bala
@Bala, place GridView out side of your UpdatePanel just to locate the problem (dont remove it)
Aristos
Same problem. Not able to locate the issue
Bala
@Bala when you place it outside the updatepanel the button works with the first click ? If not, try to change the GridView population (eg from page load to page init)
Aristos
Thanks for spending your time Aristos. Issue is because autopostback is set to true for one textbox control. Now its working
Bala
@Bala thats great that you find it.
Aristos