Reputation: 229
Within ASP.Net 4.0 is it possible to increase the vertical spacing between the errors\warnings that appear on a ValidationSummary control?
I'm finding that they are just a little to close to each other.
Thanks
Upvotes: 0
Views: 1443
Reputation: 3523
As above (IrishChieftain) but target the li nodes that get generated?
<asp:ValidationSummary CssClass="valSummary"
.valSummary li
{
padding-bottom: 10px;
}
If you want to have the ValidationSummary with a displaymode of 'List' then you have very little chance to style this as the html that is generated is just text with breaks
e.g.
<div id="MainContent_ValidationSummary1" class="valSummary" style="">
Following error occurs:
<br>
Input Country!
<br>
Input Region!
<br>
</div>
However you can set the DisplayMode to be BulletList and use CSS to hide the bullet points which will give you the same effect
e.g.
<asp:ValidationSummary CssClass="valSummary" DisplayMode="BulletList" .. />
.valSummary li
{
padding-bottom: 10px;
list-style-type: none; /* Or can just use list-style: none; */
}
Which is what I think you are after.
Upvotes: 2
Reputation: 15253
Just add some padding in CSS and apply that CSS class in your markup, to the control.
.valSummary
{
padding-bottom: 10px;
}
Upvotes: 1