what’s the difference in using tag builder and string builder to create a table in a htmlhelper class, or using the HtmlTable?
aren’t they generating the same thing??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
TagBuilderis a class that specially designed for creating html tags and their content. You are right saying that result will be anyway a string and of course you still can useStringBuilderand the result will be the same, but you can do things easier withTagBuilder. Lets say you need to generate a tag:Using
StringBuilderyou need to write something like this:It is not very cool, isn’t it?
And compare how you can build it using
TagBuilder;Isn’t that better?