I was just beginning to get a handle on ASP and now I have to drink the .NET through a firehose. Oh well...
In a piece of code just like this one (so ignore any parts not directly relevant to the question):
objMyUserControl = CType(LoadControl
("UserControls/SelectArea.ascx"), SelectArea)
AddHandler objMyUserControl.MyEvent, AddressOf ucSelectArea
I had to point to the root of the site. Remembering something from ASP, I inserted "../" just on front of the "UserControls/DSelectArea.ascx", making it:
"../UserControls/DSelectArea.ascx" which solved the problem.
In a later code example in the Wrox Press book I am using for a tutorial, they used "Request.ApplicationPath & Path.AltDirectorySeparatorChar & "UserControls/DSelectArea.ascx" to also solve the problem.
My question is, is there a reason like security or something why you should use all the code instead of 3 characters?
And/or, couldn't you put a variable in global.asax named "root" and set it equal to "Request.ApplicationPath & Path.AltDirectorySeparatorChar &" so when you needed a reference you could use "root/UserControls/DSelectArea.ascx" to get there?
Edited by sardawg