当从工具箱中拖放自定义控件到web窗体设计器中时,如何进入断点调试来调试自定义控件在设计时的代码?
当开发自定义控件时,如何断点调试自定义控件的设计时代码?
aCon类文件:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace ClassLibrary1
{
[Designer(typeof(aConDesigner))]
public class aCon:CompositeControl
{
protected override void CreateChildControls()
{
base.CreateChildControls();
TextBox tb = new TextBox();
Controls.Add(tb);
}
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
base.Render(writer);
}
}
}
aConDesigner的文件:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.Design.WebControls;
namespace ClassLibrary1
{
public class aConDesigner:CompositeControlDesigner
{
protected override void CreateChildControls()
{
base.CreateChildControls();
}
public override string GetDesignTimeHtml()
{
return base.GetDesignTimeHtml();
}
public override string GetDesignTimeHtml(System.Web.UI.Design.DesignerRegionCollection regions)
{
return base.GetDesignTimeHtml(regions);
}
}
}
在以上这两个文件的每个方法中,都加入断点,当从工具箱中拖放自定义控件aCon到web窗体设计器中时,如何进入以上断点调试来调试自定义控件在设计时的代码?