Formatting Markup Files in ASP.NET

What did you find to best format your ASP.NET markups (aspx, ascx) for readability? Any tips and / or tricks?

I'm looking for comments for indentation, lines, naming schemes, comment, <%-- --%>or whatever you can think of.

+3
source share
1 answer

Usually I just use the ctrl + k, ctrl + d shortcut in Visual Studio and let it format my code for me.

You can customize how Visual Studio code is formatted by choosing Tools → Options → Text Editor → HTML → Format

, , :

<cc1:MediaGallery ID="MediaGalleryControl" runat="server"
                  AllowUpload="false"
                  AllowUploadPreview="false"
                  MediaLibraryName="Downloads"
                  DisplayActiveContent="true"
                  DisplayFileCount="true"
                  TransformationName="Community.Transformations.MediaLibrary"
                  FooterTransformation="Community.Transformations.MediaLibraryFooter"
                  HeaderTransformation="Community.Transformations.MediaLibraryHeader"
                  HideFolderTree="true"
                  FileIDQueryStringKey="fileid"
                    />
+4

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


All Articles