1

How to disable element prefix in asp.net mvc2 template? Should I use Partial Control Instead?

1 Answer 1

3

To answer my own question, this line of code removes the hierarchical prefix from the element name..


<% ViewData.TemplateInfo.HtmlFieldPrefix = ""; %>
<%= Html.EditorFor(model => model.Description) %>

Sign up to request clarification or add additional context in comments.

1 Comment

But won't that remove the prefix on everything? What if you only wanted to affect one field?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.