J
JohnH.
Hi,
Is there a better (best practice) way to do this?
I have developed a large set of ASP.NET applications in C#. Like
most applications I have a set of utility pages that can be called by
applications or directly by users. On my own I have developed a
technique to manage the application and lib directories, but it seems a
little awkward. I was wondering how other people handle this.
My Directory Organization:
--------------------------
wwwroot\app_dir_1
\app_dir_2
\app_dir_3
wwwroot\lib\lookup
\TimedPopup
\MessageBox
\...and so on...
My Web.config file:
--------------------
In the wwwroot directory I have created a Web.config file put the
following entry in it.
<appSettings>
<add key="LibraryPagesBaseURL"
value="http://127.0.0.1/Lib/"/>
</appSettings>
My Global.asax.cs file:
-----------------------
I have added the following code to each Global.asax.cs file.
public class Global : System.Web.HttpApplication
{
public static string strLibPath =
System.Configuration.ConfigurationSettings.AppSettings.Get
("LibraryPagesBaseURL");
}
My applications then used Global.strLibPath to reference pages in the
Lib directory.
Is there a more standard way to do this?
Thanks,
John
Is there a better (best practice) way to do this?
I have developed a large set of ASP.NET applications in C#. Like
most applications I have a set of utility pages that can be called by
applications or directly by users. On my own I have developed a
technique to manage the application and lib directories, but it seems a
little awkward. I was wondering how other people handle this.
My Directory Organization:
--------------------------
wwwroot\app_dir_1
\app_dir_2
\app_dir_3
wwwroot\lib\lookup
\TimedPopup
\MessageBox
\...and so on...
My Web.config file:
--------------------
In the wwwroot directory I have created a Web.config file put the
following entry in it.
<appSettings>
<add key="LibraryPagesBaseURL"
value="http://127.0.0.1/Lib/"/>
</appSettings>
My Global.asax.cs file:
-----------------------
I have added the following code to each Global.asax.cs file.
public class Global : System.Web.HttpApplication
{
public static string strLibPath =
System.Configuration.ConfigurationSettings.AppSettings.Get
("LibraryPagesBaseURL");
}
My applications then used Global.strLibPath to reference pages in the
Lib directory.
Is there a more standard way to do this?
Thanks,
John