How may I create a strongly-typed label with HTML content inside in MVC3?
<label for="nnn"><input type="checkbox" id="nnn" />Herp</label>
I have checked the code in the w3c validator and it seems to be valid, is there a way to do it?
Thanks.
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 could use a custom HTML helper with
TagBuilder.Something like this (untested);
Might not be 100% but you get the idea. I’m not sure how to pull the “for” value out of the model. You might need
FromLambdaExpression, or another parameter.And use it like this: