Original Post
So I've been kicking around a number way to render HTML as coded (no .aspx files here). I'd like the basic signature to look something like this:
Tag.Create("div", "class", "myClass", "My textual context or more tags");
Even better would be something like this:
Tag.Create("div", {"class" = "myClass"}, "My textual context or more tags");
First thought was to use an anonymous class, but this has both performance problems and type problems. Another approach might be this:
Dictionary<string,string> Map = delegate(params string[] args) {
// pair up args as key/value pairs
};
Tag.Create("div", Map(k1,v1,k2,v2), "My test");
There are probably a number of different way to do this, but I would like one that requires a minimal amount of additional code and doesn't have to rely on an even length array. And yes performance is an issue for this rendering as well. Thanks, L-