J
Janaka
I'm making a web application on my local server which will then be rolled
out onto our live site. My problem is that i tend to have to comment out
and make a few new hard-coded lines in my files to edit changes locally and
then i have to reverse this process to make any changes live. See below
// local myLink.NavigateUrl = "http://localhost/TestSite/Printout.aspx";
myLink.NavigateUrl = http://www.mysite.com/Printout.aspx;
I'm thinking of making a variable in my web.config file to check whether i'm
running the application locally or not. So the following code below will
work:
bool isTest =
Convert.ToBoolean(ConfigurationSettings.AppSettings["TestSite"]);
if (isTest)
myLink.NavigateUrl = "http://localhost/TestSite/Printout.aspx";
else
myLink.NavigateUrl = http://www.mysite.com/Printout.aspx;
Is there a better method of doing this? Maybe with the Debug class or
something that runs in debugging mode?
Thanks, Janaka
out onto our live site. My problem is that i tend to have to comment out
and make a few new hard-coded lines in my files to edit changes locally and
then i have to reverse this process to make any changes live. See below
// local myLink.NavigateUrl = "http://localhost/TestSite/Printout.aspx";
myLink.NavigateUrl = http://www.mysite.com/Printout.aspx;
I'm thinking of making a variable in my web.config file to check whether i'm
running the application locally or not. So the following code below will
work:
bool isTest =
Convert.ToBoolean(ConfigurationSettings.AppSettings["TestSite"]);
if (isTest)
myLink.NavigateUrl = "http://localhost/TestSite/Printout.aspx";
else
myLink.NavigateUrl = http://www.mysite.com/Printout.aspx;
Is there a better method of doing this? Maybe with the Debug class or
something that runs in debugging mode?
Thanks, Janaka