Format Document (Ctrl-K, Ctrl-D)

Last post 01-07-2009 5:40 AM by purplerain. 2 replies.

Sort Posts:

  • Format Document (Ctrl-K, Ctrl-D)

    09-29-2008, 12:50 PM
    • Member
      102 point Member
    • kilik
    • Member since 11-02-2006, 1:59 PM
    • Posts 59

    Ctrl-K, Ctrl-D give me this:

         <title>
            <%= Html.Encode(ViewData["Title"]) %></title>

    Instead what I want it to do is this:

        <title><%= Html.Encode(ViewData["Title"]) %></title>

    NOTE: no line break between the opening title tag and the opening '<%' tag. What is this '<%' tag called anyway??

    I set up some 'Tag Specific Options' that work when the content is text. They don't seem to work when the content is '<%=%>' though.

     -Thx

     

     

     

     

     

     

     

  • Re: Format Document (Ctrl-K, Ctrl-D)

    09-29-2008, 1:06 PM
    Answer
    • All-Star
      36,622 point All-Star
    • rtpHarry
    • Member since 10-01-2006, 12:51 PM
    • Lincoln, England
    • Posts 5,909

     Yeah it annoys me too when it puts in the extra line breaks for seemingly no reason. I just decided to give up caring as it doesnt appear to affect the visual aspect of the site.

    There was a guy that wrote some visual studio addon for formatting the attributes in a vertical line instead of horizontal, maybe that would work better for you.

    Sorry dont have a link tho, I never tried it out because i use VWD and you need full Visual Studio to install addons.

  • Re: Format Document (Ctrl-K, Ctrl-D)

    01-07-2009, 5:40 AM
    • Member
      2 point Member
    • purplerain
    • Member since 01-07-2009, 5:34 AM
    • Posts 1

    It comes to the next line becoz in ur VS2005 settings, Tag Wrapping is enables/checked.

    If you remove Tag Wrapping, Ctrl-K + Ctrl-D will work fine.

    To do this, go-to VS2005-->Tools--> Options-->Text Editor --> HTML --> Format ---> Under Tag Wrapping -> Remove/Uncheck "Wrap tag exceeding specified length". 

    Thanks,

    Purple

Page 1 of 1 (3 items)