Files:
Website\\Controls\\map.ascx
Website\\App_Code\\map.cs
I\'d like to create a strongly typed instance of map.ascx in map.cs
Normally, in
Normally, I'd do something like this (assuming your type is "Map" and that you have the appropriate "Inherits" declaration in your .ascx file):
Map map = (Map)LoadControl("~/Controls/map.ascx");
Is there a map.ascx.cs file in Website\Controls? If so, move it to App_Code. Note you may have to update the CodeFile attribute in the .ascx file to ~\App_Code\map.ascx.cs. Alternatively, since the control is a partial class, you could just create the code in ~\App_Code\map.cs as:
public partial class controls_Map : UserControl
{
protected void Page_Load( object sender, EventArgs e )
{
...code here....
}
}
And remove all the methods from the map.ascx.cs file in the controls directory.