What is the difference between Html.Label and Html.Display?
What is the difference between Html.Label and Html.Display ?
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.
Html.Label()renders HTML markup<label />that can be used for a model entity’s attrubute.For eg,
would render
Html.Display()on the other hand renders HTML markup for entire entity based on specified templates. For eg. if you have a Person entity with multiple attributes, you define a template with markup as to how to render a Person andHtml.Display()uses that template to render Person objects across views. Phil Haack has an excellent post on display templates.