May 25, 2013, 7:11 AM
Loading Dynamic User Control in Ext.net Desktop Module causes problem
I'm using ext.net Desktop and desktop Modules. Structure of my application is Like below ;
Desktop -> Desktop Module ->Panel -> User Controls
Which mean : I have Desktop with Multiple Module Inside it. each module have panel that I can load User controls inside it. user clicks a button and I load appropriate User Control inside it. each user control has a toolbar that do CRUD operation inside that user control. the problem is, when I add for example "Persons" user control to panel of module one, every thing works great. but when I remove this control and add this control for second time, the the "init" method of this control calls two times on direct method calls, means if i press load data of all Person, the Load method calls two times. and if I remove and re add this control for third times every methods calls three time.
I load user controls whit "this.LoadControl()" method and add the result control to "Panel.ContentControls" and then call "Panel.UpdateControls()".
In each postback that causes by DirectMethodes that invoke by pressing a button on toolbar inside a user control, I recreate this user control and add two Panel without calling "UpdateContent".
thank you for your attention and help.
Desktop -> Desktop Module ->Panel -> User Controls
Which mean : I have Desktop with Multiple Module Inside it. each module have panel that I can load User controls inside it. user clicks a button and I load appropriate User Control inside it. each user control has a toolbar that do CRUD operation inside that user control. the problem is, when I add for example "Persons" user control to panel of module one, every thing works great. but when I remove this control and add this control for second time, the the "init" method of this control calls two times on direct method calls, means if i press load data of all Person, the Load method calls two times. and if I remove and re add this control for third times every methods calls three time.
I load user controls whit "this.LoadControl()" method and add the result control to "Panel.ContentControls" and then call "Panel.UpdateControls()".
In each postback that causes by DirectMethodes that invoke by pressing a button on toolbar inside a user control, I recreate this user control and add two Panel without calling "UpdateContent".
thank you for your attention and help.