469,913 Members | 2,648 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,913 developers. It's quick & easy.

Validation White Spaces

I have some <RequiredFieldValidator> on my page and
everything works fine except that there are lots of white
spaces between the web server controls that are being
validated. I've set the Display properties for all the
controls to "Dynamic" and still I can't get rid of the
white spaces between controls. It's as if there are
bunch of <br> tags separating the controls.

For example,the "HTML" look similar to this.

Some text here.
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RequireFieldValidator>
<RequireFieldValidator>
<RequireFieldValidator>

Some more text here.
Address: <TextBox Server Control>
<RequireFieldValidator>
When the above "HTML" is displayed in the browser, there
is a large white space between <RadioButtonList Server
Control> and the "Some more text here."

How can I remove all that space and still keep the
validation where it is? Or is this not possible. And if
not, what is the work around?

thanks,
Prince
Nov 18 '05 #1
3 3128
Each time you add an ENTER character into your HTML page, the browser
inserts a little gap of around 3-5 pixels. So you would expect that with 3
ENTER characters separating your invisible validators, there would be a
noticable gap.

Remove the ENTER characters. They are there to make it more human readable
but HTML doesn't need them as it uses <BR> tags to create new lines.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Prince" <an*******@discussions.microsoft.com> wrote in message
news:34****************************@phx.gbl...
I have some <RequiredFieldValidator> on my page and
everything works fine except that there are lots of white
spaces between the web server controls that are being
validated. I've set the Display properties for all the
controls to "Dynamic" and still I can't get rid of the
white spaces between controls. It's as if there are
bunch of <br> tags separating the controls.

For example,the "HTML" look similar to this.

Some text here.
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RequireFieldValidator>
<RequireFieldValidator>
<RequireFieldValidator>

Some more text here.
Address: <TextBox Server Control>
<RequireFieldValidator>
When the above "HTML" is displayed in the browser, there
is a large white space between <RadioButtonList Server
Control> and the "Some more text here."

How can I remove all that space and still keep the
validation where it is? Or is this not possible. And if
not, what is the work around?

thanks,
Prince

Nov 18 '05 #2
Thanks for the reply. I tried removing the ENTER
characters by backspacing until all the validation
controls were on one line. I still see the spaces. How
do I remove the ENTER characters?

Anyway, I viewed the source of the page and saw that
DHTML put <span> </span> tags around each Validation
Control and separated each with a <br>. My guess is that
all those <br> are the cause of the white spaces. Any
thoughts on that?

-- Prince
-----Original Message-----
Each time you add an ENTER character into your HTML page, the browserinserts a little gap of around 3-5 pixels. So you would expect that with 3ENTER characters separating your invisible validators, there would be anoticable gap.

Remove the ENTER characters. They are there to make it more human readablebut HTML doesn't need them as it uses <BR> tags to create new lines.
--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Prince" <an*******@discussions.microsoft.com> wrote in messagenews:34****************************@phx.gbl...
I have some <RequiredFieldValidator> on my page and
everything works fine except that there are lots of white spaces between the web server controls that are being
validated. I've set the Display properties for all the
controls to "Dynamic" and still I can't get rid of the
white spaces between controls. It's as if there are
bunch of <br> tags separating the controls.

For example,the "HTML" look similar to this.

Some text here.
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RequireFieldValidator>
<RequireFieldValidator>
<RequireFieldValidator>

Some more text here.
Address: <TextBox Server Control>
<RequireFieldValidator>
When the above "HTML" is displayed in the browser, there is a large white space between <RadioButtonList Server
Control> and the "Some more text here."

How can I remove all that space and still keep the
validation where it is? Or is this not possible. And if not, what is the work around?

thanks,
Prince

.

Nov 18 '05 #3
The Microsoft validators do not add a <BR> into the page. They definitely
create <span> tags but those are hidden when Display=Dynamic and the browser
does not let them take up any space. I suspect that your ASP.NET (aspx) form
actually has those <BR> codes in between the validators or they are embedded
in your ErrorMessage string.

Please post a code snippet showing the actual validators from the aspx form
and the HTML output on the page from the same area.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Prince" <an*******@discussions.microsoft.com> wrote in message
news:2e****************************@phx.gbl...
Thanks for the reply. I tried removing the ENTER
characters by backspacing until all the validation
controls were on one line. I still see the spaces. How
do I remove the ENTER characters?

Anyway, I viewed the source of the page and saw that
DHTML put <span> </span> tags around each Validation
Control and separated each with a <br>. My guess is that
all those <br> are the cause of the white spaces. Any
thoughts on that?

-- Prince
-----Original Message-----
Each time you add an ENTER character into your HTML

page, the browser
inserts a little gap of around 3-5 pixels. So you would

expect that with 3
ENTER characters separating your invisible validators,

there would be a
noticable gap.

Remove the ENTER characters. They are there to make it

more human readable
but HTML doesn't need them as it uses <BR> tags to

create new lines.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Prince" <an*******@discussions.microsoft.com> wrote in

message
news:34****************************@phx.gbl...
I have some <RequiredFieldValidator> on my page and
everything works fine except that there are lots of white spaces between the web server controls that are being
validated. I've set the Display properties for all the
controls to "Dynamic" and still I can't get rid of the
white spaces between controls. It's as if there are
bunch of <br> tags separating the controls.

For example,the "HTML" look similar to this.

Some text here.
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RadioButtonList Server Control>
<RequireFieldValidator>
<RequireFieldValidator>
<RequireFieldValidator>

Some more text here.
Address: <TextBox Server Control>
<RequireFieldValidator>
When the above "HTML" is displayed in the browser, there is a large white space between <RadioButtonList Server
Control> and the "Some more text here."

How can I remove all that space and still keep the
validation where it is? Or is this not possible. And if not, what is the work around?

thanks,
Prince

.

Nov 18 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by qwweeeit | last post: by
2 posts views Thread by linkspeed | last post: by
11 posts views Thread by gopal srinivasan | last post: by
4 posts views Thread by Andreas Prilop | last post: by
2 posts views Thread by krismath | last post: by
12 posts views Thread by JA | last post: by
3 posts views Thread by bdbeames | last post: by
1 post views Thread by runway27 | last post: by
1 post views Thread by Sudhakar | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.