any ideas for avoiding duplicate code in C# and javascript
- by ooo
i have an asp.net mvc website where i build up most of the page using C# for example building up html tables given a set of data from my viewmodel
i also have a lot of javascript that then dynamcially modifies these tables (add row for example).
the javascript code to add a new row looks extremely similar to my "rendering" code i have in C# that is used to build up the html table in the first place.
Every time i change the c# code to a add a new field, i have to remember to go back to the javascript code to do the same.
is there a better way here?