How to do region collapse for JS in Visual Studio 2012/2013

后端 未结 5 619
孤街浪徒
孤街浪徒 2021-02-05 06:29

Region code collapse for JS in Visual Studio 2012 and 2013 ?

#region AutoComplete JS
$(\"#<%=txtBirim.ClientID %>\").autocomplete({
   source: function (re         


        
相关标签:
5条回答
  • 2021-02-05 07:07

    Install web essentials

    Use the same name in end region

    //#region AutoComplete JS
    $("#<%=txtBirim.ClientID %>").autocomplete({
          source: function(request, response) {
              $.ajax({
                    url: '<%=ResolveUrl("~/Classlar/TextboxOtomatik.asmx/BirimGetir") %>',
                    data: "{ 'prefix': '" + request.term + "'}",
                    dataType: "json",
                    type: "POST",
                    contentType: "application/json; charset=utf-8",
                    success: function(data) {
                      response($.map(data.d, function(item) {
                        return {
                          label: item.split('-')[0],
                          val: item.split('-')[1]
                        }
                      }))
                    },
                    Code....
    //#endregion AutoComplete JS
    
    0 讨论(0)
  • 2021-02-05 07:07

    if you use Web Essentials in Visual Studio than you can write

    //#region AutoComplete JS
    youcode
    //#endregion
    

    see this link

    0 讨论(0)
  • 2021-02-05 07:11

    It worked for me after installing the Visual Studio Advanced Javascript Outlining extension.

    You can find the extension here

    After installing the extension just restart your Visual Studio and you can use it like this

    //#region MyRegion
    
    Code Here
    
    //#endregion 
    
    0 讨论(0)
  • 2021-02-05 07:19

    Visual Studio: Just select the code area you want to collapse then right click on the mouse, click on Outlining then click on Hide Selection. You will get the collapse (+) sign on the left vertical bar. The Shortcut Key is Ctrl+M then Ctrl+H after selection.

    0 讨论(0)
  • 2021-02-05 07:29
    1. select the javascript code you want to hide 2.Press (

    a.Ctrl+M

    then

    b.Ctrl+H ) then you can can name you region

    0 讨论(0)
提交回复
热议问题