I have a got a requirement like i need to show validation summary on top of page for that i have done like this in my view
@model MvcSampleApplication.Models.CrossFieldValidation
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
@Html.ValidationSummary(true) // here I have mentioned that validation summary true
but its not showing all messages in bulleted list
@using (Html.BeginForm("PostValues", "CrossFieldsTxtboxes"))
{
<div class ="editor-field">
@Html.TextBoxFor(m => m.TxtCrossField)
@Html.ValidationMessageFor(m=>m.TxtCrossField)
</div>
<div class =".editor-field">
@Html.DropDownListFor(m=> m.SelectedValue , Model.Items)
@Html.ValidationMessageFor(m=>m.SelectedValue)
</div>
<div class ="editor-field">
@Html.TextBoxFor(m =>m.ShippingValue)
@Html.ValidationMessageFor(m=>m.ShippingValue)
</div>
<div class =".editor-field">
@Html.DropDownListFor(m=> m.SelectedShippingItemValue , Model.Items)
@Html.ValidationMessageFor(m=>m.SelectedShippingItemValue)
</div>
<div class ="editor-field">
@Html.TextBoxFor(m =>m.DeliverPrice)
@Html.ValidationMessageFor(m=>m.DeliverPrice)
</div>
<div class =".editor-field">
@Html.DropDownListFor(m=> m.SelectedDeliveredItem , Model.Items)
@Html.ValidationMessageFor(m=>m.SelectedDeliveredItem)
</div>
<div class=".editor-field">
<input id="PostValues" type="Submit" value="PostValues" />
</div>
}
at present i am able to show the error messages near to drop down list and textbox but i want it at the top of page for that purpose what changes do i need to do in my view would any one pls suggest any ideas .. Many thanks in advance....
Note : I am using razor view engine..