我有以下控制:
public partial class Controls_ProductPanel : System.Web.UI.UserControl
{
private int _ProductID;
public int ProductID
{
get
{
return _ProductID;
}
set
{
_ProductID = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
我希望能够将它添加到这样的页面:
Controls_ProductPanel panel = new Controls_ProductPanel();
panel.ProductID = 2;
Page.Controls.Add(panel);
但 Visual Studio 似乎并没有协调Controls_ProductPanel
我得到:
The type or namespace name 'Controls_ProductPanel' could not be found. (Are you missing a using directive or an assembly reference?)