How to inherit from Control, rather than UserControl?

后端 未结 2 1814
天涯浪人
天涯浪人 2020-12-07 03:22

I have an ASP.net control that inherits from UserControl:

File 1:

public partial class Controls_AllocationDuplicate : S         


        
相关标签:
2条回答
  • 2020-12-07 03:47

    You try to make a custom control and not a user control in this case you can't use ascx file to hold your design but need to design them pragmatically.

    0 讨论(0)
  • 2020-12-07 03:53

    Try inherting from WebControl,then use Register instead of Control. Similar to this: http://www.codeproject.com/Articles/2748/Building-an-ASP-NET-custom-web-control-a-textbox-a

    0 讨论(0)
提交回复
热议问题