I’m trying to programtically write out an h1 tag in .net. I’m sure I’ve done this in the past but cannot remember how its done. I thought there was a property of the label class where the output tag could be changed.
Share
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.
You can use a
Literalcontrol and set it toPassThroughmode. This is the easiest way for thehrtagYou can find more information here
If you are creating an
h1tag then you should use thisThis will allow you to add controls to the contents of the tag.
You shouldn’t use the standard
HtmlGenericControlfor thehrtag because the implementation doesn’t allow tag self-closing. Thehrtag would be written as<hr></hr>instead of<hr/>. But you can make it self closing with a little work, by overriding the control. See here for details