G
Guest
Hello All,
I have a class that inherits from System.Web.UI.Page. In it I call the
Page.LoadControl. I am having trouble with the virtual path that the
LoadControl method accepts as its parameter.
I have the following code in a method call:
Dim uControl As CustomAddresses =
CType(Page.LoadControl("../UserControls/CustomAddresses.ascx"),
CustomAddresses)
uControl.PopulateAddressBoxes(NodeToRender.Attributes("value").Value.Trim)
Return uControl
I get the following error when I run this code:
"Cannot use a leading .. to exit above the top directory"
The virtual path from this class to the UserConrol is correct. I suspect I
am geting the error because I am using Page.LoadControl. How do I reference
a control from a class that inherits the Page class? What would the virtual
path be?
TIA,
I have a class that inherits from System.Web.UI.Page. In it I call the
Page.LoadControl. I am having trouble with the virtual path that the
LoadControl method accepts as its parameter.
I have the following code in a method call:
Dim uControl As CustomAddresses =
CType(Page.LoadControl("../UserControls/CustomAddresses.ascx"),
CustomAddresses)
uControl.PopulateAddressBoxes(NodeToRender.Attributes("value").Value.Trim)
Return uControl
I get the following error when I run this code:
"Cannot use a leading .. to exit above the top directory"
The virtual path from this class to the UserConrol is correct. I suspect I
am geting the error because I am using Page.LoadControl. How do I reference
a control from a class that inherits the Page class? What would the virtual
path be?
TIA,