我已經創建了一個用戶控件,並通過將其添加到aspx頁面進行了測試,它工作得很好。四部分名稱用戶控件Web部件-SP 2007
我寫了用戶控件,以便我可以在我的Sharepoint門戶中使用。
我已經創建了一個sharepoint webpart項目,並向該方法添加了以下代碼。
public class Nov059PM : System.Web.UI.WebControls.WebParts.WebPart
{
Control _myControl;
protected override void CreateChildControls()
{
this.Controls.Clear();
_myControl = this.Page.LoadControl("~/usercontrols/Grid.ascx");
this.Controls.Add(_myControl);
}
}
我已經放置在Grid.ascx在C:\的Inetpub \ wwwroot的\ WSS \ VirtualDirectories \ myportno \用戶控件文件夾。
我已經構建了webpart並進行了部署。
當我嘗試使用它,它說:
Could not load type 'Grid.Grid'.
Source Error:
Line 1: <%@ Control Language="C#" AutoEventWireup="true" Inherits="Grid.Grid" %>
我在想,繼承應該有四個部分組成的名稱。如何爲同一個生成四個部分名稱?