这是一个使用Visual Studio 2010的ASPX/CS项目。它是一个Configuration Manager问题。如何在ASPX项目的配置管理器中设置AppSettings
我正在成功调试(有点)一些已经在服务器上使用的代码。但是有一段代码与实时版本中的URL一起使用,不应该在debug/localhost版本中使用。
protected void Page_Load(object sender, EventArgs e)
{
if (ConfigurationManager.AppSettings["IsTesting"] == "false" && Request.Url.ToString().Contains("http:"))
{
Response.Redirect(Request.Url.ToString().Replace("http:", "https:"));
}
LoadMasterTemplate();
}
这片土地上的代码上的“Response.Redirect的......”行,当它不应该因为“IsTesting”应用程序设置应在ConfigurationManager设置为true。我如何设置?
你是对的。我在web.config文件中找到了这个: –
xarzu
2013-04-05 02:22:57