any ideas for avoiding duplicate code in C# and javascript

Posted by ooo on Stack Overflow See other posts from Stack Overflow or by ooo
Published on 2010-01-18T16:15:33Z Indexed on 2010/12/27 12:53 UTC
Read the original article Hit count: 162

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about jQuery