"How the %$#@ did you do that?" I shouted
"Don't know - I just cut and pasted" was the reply
"Can't be. Visual Studio doesn't use HTML for it's code editor"
Sure enough when we cut and pasted the code into a text editor you could see that it was perfectly styled using CSS. Afer a bit of digging we discovered that he had Power Productivity Tools installed which has the capacity to enable HTML cut and paste - Eureka!
You can get this add on using NuGet (Tools -> Extension Manager -> Online Gallery and then search for Power Productivity Tools).
Now I can cust and paste code like this straight from Visual Studio:
<h2>Log On</h2> <p> Please enter your pin and password. </p> @Html.ValidationSummary(true, "Login was unsuccessful. Please correct the errors
and try again.") @using (Html.BeginForm()) { <div> <fieldset> <legend>Account Information</legend>
.....
Enjoy!
Thanks for sharing this useful coding. It is very useful for me.
ReplyDeleteHey thanks for sharing this post. Its really helpful.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteI've just always had trouble with my blog's styles messing with the spacing of the lines and lots of other problems, so I created http://www.blogtrog.com as a personal solution, but anyone else is welcome to use it. It uses a pretty iframe where possible (like on your web page), and basic syntax highlighted code elsewhere (like inside Google Reader).
ReplyDelete