Dispose on user controls, really meant to edit the .designer.cs file?

前端 未结 3 1911
被撕碎了的回忆
被撕碎了的回忆 2021-01-20 08:33

For a user control with internal data structures that must be disposed, is the correct place to add that code to the Dispose method in the .designer.cs file, or is there an

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-20 08:51

    Could you clarify what kind of controls? ASP.NET, WinForms?

    In ASP.NET you could:

    protected override void OnUnload(EventArgs e){
         base.OnUnload(e);
         //Unload here...
    }
    

提交回复
热议问题