_ForumPost.cshtml

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Il y a 7 ans
_ForumPost.cshtml

Any page of the forum with several posts can't be validate, because each post adds own ID.

Error: Duplicate ID Id.
<input data-val="true" data-val-number="The field Id must be a number." id="Id" name="Id" type="hidden"


Wrong code
            <div class="post-text">
                @Html.Raw(Model.FormattedText)
                @Html.Hidden("Id", Model.Id)
            </div>

Good code
            <div class="post-text">
                @Html.Raw(Model.FormattedText)
            </div>
Il y a 7 ans
Thanks a lot for reporting and the fix (commit)
Il y a 7 ans
Post in forum has obsolete attribute too.

@Html.Raw(String.Format("<a name=\"{0}\"></a>", Model.Id))


If you can remove(change) it too.

Validate any forum posts and you will see warning

The name attribute is obsolete. Consider putting an id attribute on the nearest container instead.
>↩</div>↩↩<a name="3174"></a>↩<
Il y a 7 ans
Thanks a lot! I've just created one more work item
Il y a 7 ans
Fixed. Actually we can completely remove this element (not just a "name" attribute)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.