Search code examples
c#asp.netcustom-server-controls

Can Customcontrol event can be overriddden?


I have a gridview customcontrol, for that paging event has defined in seperate class library. Can i write an paging event in my aspx.cs where i am using the customcontrol instead of calling that event from seperate class file


Solution

  • If you expose events from your custom control you can use them in your codebehind yes.

    Already a bit older but it shows how to do it: Creating a Custom .NET Web Control With Events.

    I also found these tutorials to be interesting: Developing Custom ASP.NET Server Controls.