Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
基本上我想在设计时修改我的 CSS 文件。我能想到的最简单的方法就是在我的 Master ASPX 页面中注释掉一段 CSS/JS 代码。我该怎么做呢?有没有办法检测 ASP.NET 中的设计时间?
快速检测方法是:
if (HttpContext.Current == null) // You're in design mode
或者
if (this.Site != null && this.Site.DesignMode == true) { // Design Mode } else { // Run-time }