Saturday, March 02, 2013

Copy your C#/VB Code as HTML or Formatting your C#/VB code into HTML for posting article in Blog's

Usually, when I am writing article with code, I have faced lots of problems on formatting the code into HTML. I used to do the formatting using online codeformatter tools. But its not giving good look and feel. Yesterday,I thought about this while i'm in restroom on why don't we create a plugin in Visual Studio to format the code into HTML. Today, I have just google'd whether anybody created this kind of plugin before for formatting the code into HTML format for blogging. Finally, I found the nice plugin "Copy Source As HTML" .

Here is the list of steps to be followed to experiment this plugin.

1. Download the above plugin and install it for VS 2008/2010/2012.

2. Once you have installed, open the Visual Studio and open any project.

3. Select the code which you want copy as HTML, right click and select "Copy As HTML"

Screenshots:

 
 


 



4. Go the blogger/any other blogging site, paste that code in HTML.

Screenshot:



Formatted Code:


        public ActionResult Index()
        {
            ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
 
            return View();
        }
 
 

No comments: