How to override EditorFor layout? For example if i want to render some text before or after editor field.
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.
EditorForis an extension method defined onHtmlHelperclass. if you want to override it you have to subclassHtmlHelper. according to this discussion overriding extension methods is a bad idea. Even if you decide to go this way how would you make mvc use subclassedHtmlHelperinstead of default one. your best bet could be overloadingEditorFormethod and using it in views instead of default ones.