#DEBUG Preprocessor statements in ASPX page

前端 未结 8 1018
滥情空心
滥情空心 2020-12-29 22:09

I\'m trying to use a preprocessor directive in an ASPX page, but the page doesn\'t recognize it. Is this just something I can\'t do?

Background: I\'m trying to inclu

8条回答
  •  囚心锁ツ
    2020-12-29 22:49

    Here is my solution:

    protected void Page_Load(object sender, EventArgs e)
    {
        if (System.Diagnostics.Debugger.IsAttached)
        {
            ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "JQueryScript", "resources/jquery-1.3.2.js");
        }
        else
        {
            ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "JQueryScript", "resources/jquery-1.3.2.min.js");
        }
    }
    

提交回复
热议问题