How can I create an addin in Visual Studio to generate javascript, CSS and other code from a settings file

Tags: c#,css,visual-studio-2010,auto-generate

Problem :

My VS 2010 ASP.Net Web App project would have:

1. Settings file (names of actions, behavior, location of an image in an image cluster, etc.)
2. A javascript containing functions for the actions to use. This file that will get combined in with other javascript files at build time and is OK to overwrite each time as I won't need to customize anything here after it's generated.
3. A CSS file containing information such as the background attribute for a DIV that I'm using as a button to offset into a location within an image cluster.

What I want is:

An addin or some command/entity that I can easily trigger via Visual Studio UI to process the settings and recreate the files containing javascript and css for the actions specified in the settings. The reason I want this is because I'll have 30+ actions and possibly more in the future and don't want to recreate these any time I make changes of how I want them to work and easily be able to add new ones and have the JS and CSS quickly regenerated.

Solution :

You can use T4 templates. They can generate any text file based on the template that is written as a mixture of plain text and C#.

    CSS Howto..

    How to check a css propert is supported?

    joomla, CSS - show joomla module only for smartphone screens

    Dojo: how to find css definition for digit.form.filteringselect, especially the drop down list?

    How to make a descriptions list inline?

    How to wrap text inside an iframe with designMode on, using css and also javascript if necessary?

    I have an text input inside a div, how do I get the background of the div to change when the input has focus?

    How do you make a nav bar “sticky”?

    How to add padding to the cells of a table with CSS [closed]

    How can I get a very “blurred” box-shadow out of only the bottom of the box?

    android - How to build complex views that stretch?

    How can I disable the “Up” arrow via CSS

    How to word wrap text in HTML?

    How can I use CSS pseudo-classes with GWT's UiBinder?

    How do I align the list items in an
      with my


    How to style CSS for input box's width as a percentage when it has border and padding?

    background image also header image cc trick how to do it? [closed]

    How to add an icon to a button at the bottom right corner

    Height isn't showing up full on everything except Chrome

    How to make cut off in CSS as shown in the attached image?

    How to add head section in a page that has layout template

    how to make the text in a div to not overflow its width

    How do I specify XPATH or CSS in Nokogiri to scrape a page's table data?

    How to not display css padding when span element is empty

    Twitter widget covers up another div that might appear over it . How to make twitter widget appear under?

    How to skew image with CSS?

    How to set image in horizontal center of DIV to fill page width?

    How to show local html file into webview?

    How to create
    with special form in CSS or Javascript

    How to make a scrollable div inside of a div with a specific height

    How do you stop a single-page site from automatically scrolling when resizing the browser?