Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Label Inside EditorTemplate Disappears During Validation #2778

Closed
Reafidy opened this issue Jul 2, 2015 · 5 comments
Closed

Label Inside EditorTemplate Disappears During Validation #2778

Reafidy opened this issue Jul 2, 2015 · 5 comments
Assignees
Milestone

Comments

@Reafidy
Copy link

Reafidy commented Jul 2, 2015

I am using ASP.net MVC 6 and the following EditorTemplate:

<div class="form-group">        
    @Html.LabelFor(m => m, new { @class = "control-label col-md-2" })
    <div class="col-md-10">
        @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue,  htmlAttributes)
        @Html.ValidationMessageFor(m => m, null, new { @class = "help-block" })
    </div>
</div>

When attempting to save the form with a deliberate error, the page refreshes and correctly shows the validation error but the label completely disappears. It is not hidden it is completely gone from the html source.

Here is my EditorFor:

 @Html.EditorFor(model => model.Description, new { htmlAttributes = new { @class = "form-control" } })

A bug?

@danroth27
Copy link
Member

@ajaybhargavb Please try to reproduce this

@Reafidy
Copy link
Author

Reafidy commented Jul 6, 2015

New to Github and At the risk of sounding completely dumb, what does the '2- working' label mean?

@danroth27
Copy link
Member

@Reafidy It just means that the person assigned to the issue is now working on the issue.

@Reafidy
Copy link
Author

Reafidy commented Jul 8, 2015

Thanks.

@ajaybhargavb
Copy link
Contributor

92f3e21

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants