Reputation: 12159
Is there a built in function (I know I can easily create one) to create simple tags:
MakeTag("Tag","myvalue") would generate:
<Tag>myvalue</Tag>
I'd rather something simpler than an XML class and all I need is just a tag created like this.
Also, any suggestions on a parser for the same?
Upvotes: 2
Views: 68
Reputation: 17388
There is also the TagBuilder
class in ASP.NET MVC.
I would use LINQ for simple parsing:
http://www.switchonthecode.com/tutorials/introduction-to-linq-simple-xml-parsing
Upvotes: 0
Reputation: 351758
Without rolling your own implementation, HtmlGenericControl
is about as close as you are going to get:
var control = new HtmlGenericControl("Tag") { InnerText = "myvalue" };
Upvotes: 7