我正在尝试解决Visual Studio中的错误,the suggestion is to stop using
UserControls
and use Control
instead..
所以我将我的所有UserControl转换为Control,例如:
public partial class Controls_UserManagement_GroupManager : System.Web.UI.UserControl { protected void Page_Load(object sender,EventArgs e) { if (!IsPostBack)
变
public partial class Controls_UserManagement_GroupManager : System.Web.UI.Control { protected void Page_Load(object sender,EventArgs e) { if (!IsPostBack)
除了没有Control.IsPostBack?
如何用Control替换UserControl?
系列
这个问题是正在进行的Stackoverflow系列中的一个,“模板化用户控件”:
> How to add a Templating to a UserControl?
> How to inherit from Control,rather than UserControl?
> UserControl has IsPostBack,but Control does not
> UserControl does not have public property named ContentTemplate
> How do i specify CodeFileBaseClass from web.config?