I am trying to add a user control dynamically in another user control but getting error message "The file '/controls/request_inspector.ascx' does not exist."
I added a reference to the control in the .aspx page that will use it, like this:
<%@ Reference Control="request-inspector.ascx" %>
And in the UserControl I added a ClassName like this:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="request-inspector.ascx.vb"
Inherits="Web.PO.request_inspector" ClassName="request_inspector" %>
Page Load event
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim c As request_inspector
c = CType(LoadControl("~/controls/request_inspector.ascx"), request_inspector)
c.ID = "c1"
phReqInspectors.Controls.Add(c)
c = Nothing
End Sub
User Control is in the controls folder and i have tried changing the path but still the same error message. Here is the full path C:\Projects\PSource\projects\POProject\Web.PO\controls\request-inspector.ascx