基本上我想在设计时修改我的CSS文件。我能想到的最简单的方法是在我的Master ASPX页面中注释掉一块CSS / JS代码。我该怎么做呢?无论如何在ASP.NET中检测设计时间?
答案 0 :(得分:3)
快速检测方法是:
if (HttpContext.Current == null)
// You're in design mode
或
if (this.Site != null && this.Site.DesignMode == true)
{
// Design Mode
}
else
{
// Run-time
}