Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Help me,

I am taken a grid view in asp.net, and create some dynamic controls in that.
If I create dynamic controls in row created event, the row created event calls every postback and also that dynamic cotrol events two times raised.


Regards,
Chaitanya
Posted

1 solution

If you have attached a row create event to your grid that means it will call each and every time when your grid has bind data.

means if you write your code to bind gridview on your page load and it will called when you post back your page then the row create event will fire and it will called as much time as the grid has rows to be created.
 
Share this answer
 
Comments
chaitanya.gorupina 10-May-12 5:23am    
Thaks Vaishnav, but the row created event fires not only grid binding time, event that if I click any other links the row created evet fired. how it is possible....... pls .. send the solution.....
Tejas Vaishnav 10-May-12 5:30am    
means on the page if you click on any other link instead of your grid then it will also fire.?

so have you checked that in your page load you put IsPostback with not sign to prevent unwanted binding to your grid.

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