Suppression ASP.NET PageMethods Documentation Comments

I have an ASP.NET WebForm application that has several WebMethod'sin C # that gets called through jQuery ajax. Everything works fine, except that I notice that when I look at the source on the page, I see something like this:

<script type="text/javascript">
    //<![CDATA[
    var PageMethods = function() {
        PageMethods.initializeBase(this);
        this._timeout = 0;
        this._userContext = null;
        this._succeeded = null;
        this._failed = null;
    }
    PageMethods.prototype = {
        _get_path:function() {
            var p = this.get_path();
            if (p) return p;
            else return PageMethods._staticInstance.get_path();},
            CreateNewFranchise:function(name,firstName,lastName,address1,address2,streetSuffixId,city,stateId,county,zip,mainPhoneAreaCode,mainPhoneTypeId,mainPhonePrefix,mainPhoneSuffix,storeCode,storeKey,merchantId,corporateShop,franchiseNumber,succeededCallback, failedCallback, userContext) {
            /// <param name="name" type="String">System.String</param>
            /// <param name="firstName" type="String">System.String</param>
            /// <param name="lastName" type="String">System.String</param>
            /// <param name="address1" type="String">System.String</param>
            /// <param name="address2" type="String">System.String</param>
            /// <param name="streetSuffixId" type="String">System.String</param>
            /// <param name="city" type="String">System.String</param>
            /// <param name="stateId" type="String">System.String</param>
            /// <param name="county" type="String">System.String</param>
            /// <param name="zip" type="String">System.String</param>
            /// <param name="mainPhoneAreaCode" type="String">System.String</param>
            /// <param name="mainPhoneTypeId" type="String">System.String</param>
            /// <param name="mainPhonePrefix" type="String">System.String</param>
            /// <param name="mainPhoneSuffix" type="String">System.String</param>
            /// <param name="storeCode" type="String">System.String</param>
            /// <param name="storeKey" type="String">System.String</param>
            /// <param name="merchantId" type="String">System.String</param>
            /// <param name="corporateShop" type="Boolean">System.Boolean</param>
            /// <param name="franchiseNumber" type="String">System.String</param>
            /// <param name="succeededCallback" type="Function" optional="true" mayBeNull="true"></param>
            /// <param name="failedCallback" type="Function" optional="true" mayBeNull="true"></param>
            /// <param name="userContext" optional="true" mayBeNull="true"></param>
            ...
            ...
            ...

I am wondering if these lines are needed ///, and if not, is there a way to get ASP.NET to suppress them? For me, they look as if they are just markups of XML documentation, which is not necessary. Having about 8 WebMethod'sin my C #, these lines add up and I would like to filter them out if possible.

+4
source share
1

. , web.config:

  • <deployment retail="false" />
  • <compilation debug="false" />

- , ScriptManager.ScriptMode Release.

, PageMethods script, PageClientProxyGenerator. ScriptManager :

public bool IsDebuggingEnabled {
    get {
        // Returns false when:
        // - Deployment mode is set to retail (override all other settings)
        // - ScriptMode is set to Auto or Inherit, and debugging it not enabled in web.config
        // - ScriptMode is set to Release

        if (DeploymentSectionRetail) {
            return false;
        }
        if (ScriptMode == ScriptMode.Auto || ScriptMode == ScriptMode.Inherit) {
            return AppLevelCompilationSection.Debug;
        }
        return (ScriptMode == ScriptMode.Debug);
    }
}
+2

Source: https://habr.com/ru/post/1540596/


All Articles