Home All Groups Group Topic Archive Search About

Unnecessary spaces when rendering list controls

Author
29 Jan 2009 3:17 AM
Nathan Sokalski
When a DropDownList is rendered, the <option> tags are all rendered on
separate lines, as follows:

        <option value="mon">Monday</option>
        <option value="tues">Tuesday</option>
        <option value="wed">Wednesday</option>
        <option value="thur">Thursday</option>
        <option value="fri">Friday</option>

Notice that each <option> tag is not only on its own line, but is indented
as well. Why is this extra space rendered? It increases the download size of
the page (maybe only a little, but if a page has a lot of DropDownLists with
a lot of options, such as a page with multiple DropDownLists for states, it
can be a lot) for no reason (at least not that I know of). Is there any easy
way to avoid this extra space? I'm not trying to complain, I just don't see
the point in increasing download size for no reason.
--
Nathan Sokalski
njsokal***@hotmail.com
http://www.nathansokalski.com/

Author
25 Feb 2009 9:43 PM
Carlo Pagano
Excellent question, I've been looking into this and I can't understand why
such "overhead" is introduced. I have a project which has a bunch of
dropdownlists on a certain page and the increased download size is ridiculous.

Show quoteHide quote
"Nathan Sokalski" wrote:

> When a DropDownList is rendered, the <option> tags are all rendered on
> separate lines, as follows:
>
>         <option value="mon">Monday</option>
>         <option value="tues">Tuesday</option>
>         <option value="wed">Wednesday</option>
>         <option value="thur">Thursday</option>
>         <option value="fri">Friday</option>
>
> Notice that each <option> tag is not only on its own line, but is indented
> as well. Why is this extra space rendered? It increases the download size of
> the page (maybe only a little, but if a page has a lot of DropDownLists with
> a lot of options, such as a page with multiple DropDownLists for states, it
> can be a lot) for no reason (at least not that I know of). Is there any easy
> way to avoid this extra space? I'm not trying to complain, I just don't see
> the point in increasing download size for no reason.
> --
> Nathan Sokalski
> njsokal***@hotmail.com
> http://www.nathansokalski.com/
>
>
>