Remove blank space acquired by validation messages in Asp .Net

 In this article we will see how to remove blank space acquired by validation messages in asp .net. This problems mostly occurs when we use multiple validators with single control. Whenever single validator passes validation and other one failed. Failed validator takes blank space in the page.

Lets see whats the problem:

Remove-blank-sapce-from-validation-messages-asp-net-codingfusion

Remove-blank-sapce-from-validation-messages-asp-net-codingfusion

 

You can clearly see blank space acquired by validators in the second image.

This can be removed by using inbuilt property "Display="Dynamic" of validators. By using "Display="Dynamic"" only failed validations will appear on page.

Result after using Display="Dynamic" property:

Remove blank space from validators in asp .net codingfusion anuj

Remove-blank-space-from-validation-messages-in-asp-net-codingfusion-anuj

HTML:

 

 

 

 

Name
Age
Email
 
About Us | Terms of Use | Privacy Policy | Disclaimer | Contact Us Copyright © 2012-2024 CodingFusion
50+ C# Programs for beginners to practice