SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am creating custom web part editor part. I have created a text box which should only allow integer values. If non integer value is filled in , after clicking on "Apply" , error message is displayed on the label below it.

enter image description here

Problem : The label to show error message is initially set to visible = false. But still the editor web part occupies the space(Marked on Red box). How can i remove the space ? enter image description here

share|improve this question
You might want to work on a more friendly message... – SHug Oct 8 '11 at 15:55

I'd take a look at the rendered Toolpart in IE Dev tools, see what element's creating the space, and see if you can either eliminate it in the codebehind, or reduce it's spacing (padding, margins?) via CSS.

share|improve this answer

You can try to set Display="Dynamic" on the validator control (although it should not be rendered when visible=false). Maybe the additional space is cause by a line break between the TextBox and Validator control?

share|improve this answer
Display=dynamic did not work as in an adding the label through .cs file. There is not line break between textbox and validator control – Monica Jagani Sep 9 '11 at 10:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.