Out*_*per 30 c# asp.net debugging
我在这里画一个空白的东西应该很简单......
我想做的事情如下:
<my:control runat="server" id="myid" Visible="<%= (is compilation debug mode?) %>" />
Run Code Online (Sandbox Code Playgroud)
Adr*_*zar 55
该HttpContext.IsDebuggingEnabled属性:
using System.Web;
if (HttpContext.Current.IsDebuggingEnabled) { /* ... */ }
Run Code Online (Sandbox Code Playgroud)
从文档:
true如果请求处于调试模式,则获取一个值,该值指示当前HTTP请求是否处于调试模式[...] ; 否则,false.
Nic*_*rey 49
这应该让你获得节组中的<compilation>元素<system.web>:
using System.Web.Configuration ;
. . .
CompilationSection compilationSection = (CompilationSection)System.Configuration.ConfigurationManager.GetSection(@"system.web/compilation") ;
. . .
// check the DEBUG attribute on the <compilation> element
bool isDebugEnabled = compilationSection.Debug ;
Run Code Online (Sandbox Code Playgroud)
简单!
mat*_*ieu 15
<my:control runat="server" id="myid" Visible="<%= HttpContext.Current.IsDebuggingEnabled %>" />
Run Code Online (Sandbox Code Playgroud)
见http://msdn.microsoft.com/en-us/library/system.web.httpcontext.isdebuggingenabled%28v=vs.90%29.aspx
或 http://www.west-wind.com/weblog/posts/2007/Jan/19/Detecting-ASPNET-Debug-mode,下面有丰富的反馈意见.
| 归档时间: |
|
| 查看次数: |
20682 次 |
| 最近记录: |