In my mind,I think it's because of the OnInit problem——it will recreate controls again and again:I mean you can try to set a property called "Flag" with viewstate to check whether it's the first load or not,and say if(Flag){……}。
And anyway,I think you are using CreateChildControls method to be overriden……。So please do to set ChildControlCreated=true in order to avoid being recreated again。
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Event handler for dynamically created linkbuttons in custom webpart
Feb 26, 2012 12:05 AM|LINK
Hello:)
In my mind,I think it's because of the OnInit problem——it will recreate controls again and again:I mean you can try to set a property called "Flag" with viewstate to check whether it's the first load or not,and say if(Flag){……}。
And anyway,I think you are using CreateChildControls method to be overriden……。So please do to set ChildControlCreated=true in order to avoid being recreated again。
Reguards!