I have created a user control and tested it by adding it to the aspx page, it works very well.
I wrote the user control, so that I can use in my Sharepoint Portal.
I have created a sharepoint webpart project and added the following code to the method.
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);
}
}
I have placed the Grid.ascx in the C:\inetpub\wwwroot\wss\VirtualDirectories\myportno\usercontrols folder.
I have built the webpart and deployed it.
When I try to use it, it says:
Could not load type 'Grid.Grid'.
Source Error:
Line 1: <%@ Control Language="C#" AutoEventWireup="true" Inherits="Grid.Grid" %>
I am thinking, Inherits should be four part name. How do I generate four part name for the same?