h3n
h3n

Reputation: 5248

How to disable element naming prefix in asp.net mvc2 template?

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

Upvotes: 1

Views: 173

Answers (1)

h3n
h3n

Reputation: 5248

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) %>

Upvotes: 3

Related Questions