<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Corner &#187; HTML/CSS</title>
	<atom:link href="http://CodeCorner.galanter.net/category/htmlcss/feed/" rel="self" type="application/rss+xml" />
	<link>http://CodeCorner.galanter.net</link>
	<description>ASP.NET, XML, SQL and Javascript tips and tricks</description>
	<lastBuildDate>Sun, 19 Feb 2012 03:04:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Style Rounded Corner images of UltraWebTab thru external stylesheet</title>
		<link>http://CodeCorner.galanter.net/2012/02/17/style-rounded-corner-images-of-ultrawebtab-thru-external-stylesheet/</link>
		<comments>http://CodeCorner.galanter.net/2012/02/17/style-rounded-corner-images-of-ultrawebtab-thru-external-stylesheet/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 17:21:08 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1660</guid>
		<description><![CDATA[Infragistics UltraWebTab control offers multiple styling options, many of them can be set via external CSS classes. As a matter of fact about only element you cannot style via external stylesheet is rounded corner images. Or can you? By default images used to give the tabs rounded-corner look are referenced directly in UltraWebTab ASPX markup: [...]]]></description>
			<content:encoded><![CDATA[<p>Infragistics UltraWebTab control offers multiple styling options, many of them can be set via external CSS classes. As a matter of fact about only element you cannot style via external stylesheet is rounded corner images. Or can you?</p>
<p>By default images used to give the tabs rounded-corner look are referenced directly in UltraWebTab ASPX markup:</p>
<pre class="brush: xml; title: ; notranslate">&lt;RoundedImage
   SelectedImage=&quot;./images/ig_tab_selected.jpg&quot;
   NormalImage=&quot;./images/ig_tab_normal.gif&quot;
   HoverImage=&quot;./images/ig_tab_hover.jpg&quot;
   FillStyle=&quot;LeftMergedWithCenter&quot;&gt;
&lt;/RoundedImage&gt;</pre>
<p>So, for example if SelectedImage looks like this:</p>
<p><img src="http://kitchen.galanter.net/sitepic/tab_template_image.jpg" alt="Default Selected Image of UltraWebTab" /></p>
<p>It will give your tab appearance like this</p>
<p><img src="http://kitchen.galanter.net/sitepic/Tab_Original_Image.png" alt="Selected Image of UltraWebTab in action" /></p>
<p>Let&#8217;s examine it closer.<span id="more-1660"></span> If your look in browser at rendered HTML of this tab it looks like this (I&#8217;ve removed some attributes to simplify view):</p>
<pre class="brush: xml; title: ; notranslate">&lt;TD class=xuwtHome_2&gt;My Test Tab&lt;/TD&gt;
&lt;TD width=&quot;5&quot; class=xuwtHome_2R&gt;&amp;nbsp;&lt;/TD&gt;
</pre>
<p>Where</p>
<pre class="brush: css; title: ; notranslate">.xuwtHome_2 {
   BACKGROUND: url(./images/ig_tab_selected.jpg) no-repeat left top;
}

.xuwtHome_2R {
   BACKGROUND: url(./images/ig_tab_selected.jpg) no-repeat right top;
}
</pre>
<p>So in reality tab consists of 2 <em>TD</em> elements: First one, on the left, takes the left part of the image as a background; Second on the right &#8211; small &#8220;rounded&#8221; part from the right part of the image (in this case 5 pixels, see <em>TD</em>&#8216;s <em>WIDTH</em> atribute)</p>
<p><img src="http://kitchen.galanter.net/sitepic/Tab_Explained_Image.png" alt="Selected Image of UltraWebTab Explained" /></p>
<p>Knowing this we can now model our CSS class to reference and render rounder corner image:</p>
<pre class="brush: css; title: ; notranslate">.TabStyleSelected /* Style of left TD. Add font and other styles for tab title */
{
   background-image: url(&quot;./images/ig_tab_selected.jpg&quot;) !important;
}

.TabStyleSelected + td /* Style of right TD. Width from width of right rounded part */
{
   background-image: url(&quot;./images/ig_tab_selected.jpg&quot;) !important;
   width:5px !important;
}</pre>
<p>Note &#8220;+&#8221; CSS selector on <em>Line 6</em>. It tells browser to apply this style to next sibling TD element (in our case right TD) of the element to which original style is applied (in our case left TD element). Also note &#8220;width&#8221; attribute on <em>Line 9</em>. It is the width of right &#8220;rounded&#8221; part of the image. If your image is different and rounded part takes more/less &#8211; adjust this value accordingly.</p>
<p>After the style is set like this it just a matter of assigning class to tab element(s). If you want to make this style default for all tabs &#8211; use <em>SelectedTabStyle</em> element:</p>
<pre class="brush: xml; title: ; notranslate">&lt;SelectedTabStyle CssClass=&quot;TabStyleSelected&quot;/&gt;</pre>
<p>If you want to apply separate round corner styles to individual tabs (which was not possible originally with round corner images <del>set in stone</del> set in ASPX markup) you can do that as well:</p>
<pre class="brush: xml; title: ; notranslate">&lt;igtab:Tab&gt;
   &lt;SelectedStyle CssClass=&quot;TabStyleSelected&quot; /&gt;
&lt;/igtab:Tab&gt;</pre>
<p>Or even do it programmaticaly</p>
<pre class="brush: vb; title: ; notranslate">oTabControl.SelectedStyle.CssClass = &quot;TabStyleSelected&quot;</pre>
<p>Similar approach can be used to define &#8220;normal&#8221; and hover tab styles and if you need to change rounded styles (either globally, or per tab) no need to change ASPX markup, no need to rename original images or paste your images over original, just create new images and reference them in the stylesheet.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2008/01/30/removechild-and-ssl-and-infragistics-webhtmleditor/" rel="bookmark" class="crp_title">removeChild, SSL and Infragistics WebHtmlEditor</a></li><li><a href="http://CodeCorner.galanter.net/2009/08/13/easy-rounded-corners-in-pure-htmlcss/" rel="bookmark" class="crp_title">Easy rounded corners in pure HTML/CSS</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2012/02/17/style-rounded-corner-images-of-ultrawebtab-thru-external-stylesheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Style IFRAME scrollbars in IE</title>
		<link>http://CodeCorner.galanter.net/2012/02/15/style-iframe-scrollbars-in-ie/</link>
		<comments>http://CodeCorner.galanter.net/2012/02/15/style-iframe-scrollbars-in-ie/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 23:05:47 +0000</pubDate>
		<dc:creator>yomgal</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1653</guid>
		<description><![CDATA[Internet Explorer offer CSS elements to style scrollbars, for example class applied to a DOM element will render nice flat scrollbars: Yes, it&#8217;s not standard CSS, but other browsers offer similar extensions (WebKit, I am looking at you). So, it works nice and well, but what if you want to style scrollbars of an IFRAME? [...]]]></description>
			<content:encoded><![CDATA[<p>Internet Explorer offer CSS elements to style scrollbars, for example class</p>
<pre class="brush: css; title: ; notranslate">.FlatScrollbars
{
   scrollbar-face-color: #f0f0f0;
   scrollbar-shadow-color: silver;
   scrollbar-highlight-color: silver;
   scrollbar-3dlight-color: #f0f0f0;
   scrollbar-darkshadow-color: #f0f0f0;
   scrollbar-track-color: #f0f0f0;
   scrollbar-arrow-color: #000000;
}</pre>
<p>applied to a DOM element will render nice flat scrollbars:</p>
<p><img src="http://kitchen.galanter.net/sitepic/FlatScrollbars.png" alt="Flat Scrollbars in Internet Explorer" /></p>
<p>Yes, it&#8217;s not standard CSS, but other browsers offer similar extensions (WebKit, I am looking at you). So, it works nice and well, but what if you want to style scrollbars of an IFRAME?<span id="more-1653"></span></p>
<p>First of all, the above style has to be applied to the child page loaded into IFRAME, *not* parent page that hosts the IFRAME. Ordinary it&#8217;s applied to BODY element of the page. But sometimes, for example if your DOCTYPE is XHTML 1.0 Transitional &#8211; this doesn&#8217;t work. If that&#8217;s the case &#8211; and this is a kicker &#8211; apply the style to HTML element of the page, yes I am talking about</p>
<pre class="brush: xml; title: ; notranslate">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; class=&quot;FlatScrollbars&quot;&gt;</pre>
<p>or even (if you want to assign class programmaticaly in ASP.NET code behind) in ASPX markup:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; runat=&quot;server&quot; id=&quot;xHTML&quot;&gt;</pre>
<p>and in VB code behind:</p>
<pre class="brush: vb; title: ; notranslate">xhtml.Attributes(&quot;class&quot;) = &quot;FlatScrollbars&quot;</pre>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2011/11/08/clientscript-registerstartupscript-script-injected-but-not-executed/" rel="bookmark" class="crp_title">ClientScript.RegisterStartupScript: script injected, but not executed</a></li><li><a href="http://CodeCorner.galanter.net/2009/08/13/easy-rounded-corners-in-pure-htmlcss/" rel="bookmark" class="crp_title">Easy rounded corners in pure HTML/CSS</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2012/02/15/style-iframe-scrollbars-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Correctly apply external styles to UltraWebGrid</title>
		<link>http://CodeCorner.galanter.net/2012/02/09/correctly-apply-external-styles-to-ultrawebgrid/</link>
		<comments>http://CodeCorner.galanter.net/2012/02/09/correctly-apply-external-styles-to-ultrawebgrid/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 22:44:24 +0000</pubDate>
		<dc:creator>yomgal</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1647</guid>
		<description><![CDATA[Classic Infragistics UltraWebGrid allows you to programmaticaly specify CSS styles for its various elements. For example code like this: Would set style of grid header and rows via external CSS class. You would expect that simple defining classes like this: should do the trick, but you may experience some unwanted, erratic behavior: styles getting lost, [...]]]></description>
			<content:encoded><![CDATA[<p>Classic Infragistics UltraWebGrid allows you to programmaticaly specify CSS styles for its various elements. For example code like this:</p>
<pre class="brush: vb; title: ; notranslate">xmyGrid.DisplayLayout.HeaderStyleDefault.CssClass = &quot;HeaderStyle&quot;
xmyGrid.DisplayLayout.RowStyleDefault.CssClass = &quot;RowStyle&quot;</pre>
<p>Would set style of grid header and rows via external CSS class. You would expect that simple defining classes like this:</p>
<pre class="brush: css; title: ; notranslate">.HeaderStyle {  /* style definition goes here */ }
.RowStyle {  /* style definition goes here */ }</pre>
<p>should do the trick, but you may experience some unwanted, erratic behavior: styles getting lost, styles getting mixed up (row would get a header style and vise versa).</p>
<p>To fix this we should let grid know that header style should apply only to header row (THEAD/TH HTML elements) and row style applies only to rows with data (TBODY/TD elements). This is done via slight adjustments of the above CSS to point it to specific elements:</p>
<pre class="brush: css; title: ; notranslate">THEAD.HeaderStyle TR TH{  /* style definition goes here */ }
TBODY.RowStyle TR TD {  /* style definition goes here */ }</pre>
<p>This way there&#8217;s no confusion, styles apply exactly were they belong. Also you may need to set grids <em>MergeStyles</em> property to <em>False</em> and make each class fully define it&#8217;s element (including fonts, colors, backgrounds etc.)</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2012/02/17/style-rounded-corner-images-of-ultrawebtab-thru-external-stylesheet/" rel="bookmark" class="crp_title">Style Rounded Corner images of UltraWebTab thru external stylesheet</a></li><li><a href="http://CodeCorner.galanter.net/2010/08/09/ultrawebgrid-highlight-row-on-mouseover-with-selection-enabled/" rel="bookmark" class="crp_title">Ultrawebgrid: Highlight row on MouseOver with Selection enabled</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2012/02/09/correctly-apply-external-styles-to-ultrawebgrid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UltraWebGrid TopItemSpacing=&#8221;Auto&#8221;: Solution for FireFox</title>
		<link>http://CodeCorner.galanter.net/2012/01/12/ultrawebgrid-topitemspacing-auto-solution-for-firefox/</link>
		<comments>http://CodeCorner.galanter.net/2012/01/12/ultrawebgrid-topitemspacing-auto-solution-for-firefox/#comments</comments>
		<pubDate>Thu, 12 Jan 2012 21:46:40 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1621</guid>
		<description><![CDATA[If you&#8217;re still using classic Infragistics Controls and want to make them work in modern browsers, sometimes a little additional work is required. Hopefully this little trick will save you some time. UltraWebGrid has a neat property TopItemSpacing, when set to Auto it automatically spreads top level menu items across the menu control, giving them [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re still using classic Infragistics Controls and want to make them work in modern browsers, sometimes a little additional work is required. Hopefully this little trick will save you some time.</p>
<p>UltraWebGrid has a neat property <em>TopItemSpacing</em>, when set to <em>Auto</em> it automatically spreads top level menu items across the menu control, giving them nice spacing in between. Unfortunately this property seems to work in Internet Explorer only, in Firefox (and Chrome and etc.) it is ignored, rendering menu in <em>Compact</em> mode giving top level items crowded &#8220;too-close-for-comfort&#8221; look.</p>
<p>The solution is to take spacing in our own hands. Set <em>TopItemSpacing</em> to <em>Compact</em> and instead add right padding to <em>TopLevelParentItemStyle</em> and <em>TopLevelLeafItemStyle</em> elements of the menu. For example (from the markup point of view):</p>
<pre class="brush: xml; highlight: [2]; title: ; notranslate">&lt;TopLevelLeafItemStyle Cursor=&quot;Hand&quot; Height=&quot;18px&quot; BorderWidth=&quot;1px&quot; Font-Size=&quot;8pt&quot;&gt;
   &lt;Padding Right=&quot;6px&quot; /&gt;
&lt;/TopLevelLeafItemStyle&gt;</pre>
<p>Actual pixel value of the padding is up to your particular scenario, but the final result is top level menu items will be nicely spaced both in IE and in Firefox.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2011/12/06/ultrawebmenu-when-background-doesnt-change-on-hover/" rel="bookmark" class="crp_title">UltraWebMenu: When background doesn&#8217;t change on hover in IE9</a></li><li><a href="http://CodeCorner.galanter.net/2011/02/24/infragistics-webdatamenu-csom-additemremoveitem-workaround/" rel="bookmark" class="crp_title">Infragistics WebDataMenu CSOM addItem/removeItem workaround</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2012/01/12/ultrawebgrid-topitemspacing-auto-solution-for-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClientScript.RegisterStartupScript: script injected, but not executed</title>
		<link>http://CodeCorner.galanter.net/2011/11/08/clientscript-registerstartupscript-script-injected-but-not-executed/</link>
		<comments>http://CodeCorner.galanter.net/2011/11/08/clientscript-registerstartupscript-script-injected-but-not-executed/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 05:04:38 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1479</guid>
		<description><![CDATA[This was one weird mystery. I have used ASP.NET&#8217;s method ClientScript.RegisterStartupScript countless times to inject client-side JavaScript into page&#8217;s markup from the server-side code and it always worked perfectly. This time I created a very basic page from scratch: And then injected client-side script into it: where ProcessData() is function from one of the scripts, [...]]]></description>
			<content:encoded><![CDATA[<p>This was one weird mystery. I have used ASP.NET&#8217;s method <em>ClientScript.RegisterStartupScript</em> countless times to inject client-side JavaScript into page&#8217;s markup from the server-side code and it always worked perfectly. This time I created a very basic page from scratch:</p>
<pre class="brush: xml; title: ; notranslate">&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head runat=&quot;server&quot;&gt;
    &lt;title&gt;My Page&lt;/title&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;script1.js&quot; /&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;script2.js&quot; /&gt;
    &lt;script type=&quot;text/javascript&quot; src=&quot;script3.js&quot; /&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;xfrmMain&quot; runat=&quot;server&quot;&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>And then injected client-side script into it:</p>
<pre class="brush: vb; title: ; notranslate">ClientScript.RegisterStartupScript(Me.GetType, &quot;JSCode&quot;, &quot;ProcessData();&quot;, True)</pre>
<p>where <em>ProcessData()</em> is function from one of the scripts, loaded in the <em>HEAD</em> tag. The script injected just fine, I got a beautiful insert at the bottom of the rendered page:</p>
<pre class="brush: xml; title: ; notranslate">&lt;script type=&quot;text/javascript&quot;&gt;
//&lt;![CDATA[
ProcessData();//]]&gt;
&lt;/script&gt;</pre>
<p>The problem was &#8211; it didn&#8217;d do squat &#8211; the script did not execute. Why?<span id="more-1479"></span></p>
<p>Million dollar question. Googling didn&#8217;t help, there were a lot of solutions for scenarios wherw the script <em>didn&#8217;t get injected</em>, but once it was on the page &#8211; it always executed. I replaced the custom function call with a simple <em>alert</em>, thinking something might be the matter with  the way scripts are loaded &#8211; it didn&#8217;t fire.</p>
<p>Finally looking back at HTML markup I noticed something different about the scripts are loaded. The tags are self-closing. But this shouldn&#8217;t be a problem, right? If element contains just attributes and no data &#8211; this shouldn&#8217;t cause any issues? Well, apparently in case of <em>SCRIPT</em> tag &#8211; WRONG! It didn&#8217;t throw any errors, simple did not execute the scripts (even the ones that has nothing to do with loaded JS).</p>
<p>When I changed script loading part to:</p>
<pre class="brush: xml; title: ; notranslate">&lt;script type=&quot;text/javascript&quot; src=&quot;script1.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;script2.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;script3.js&quot;&gt;&lt;/script&gt;</pre>
<p>function created by <em>ClientScript.RegisterStartupScript</em> executed.</p>
<p>Moral: Always close your script tag with closing tag.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2009/07/28/injecting-client-script-into-infragistics-async-postback/" rel="bookmark" class="crp_title">Injecting client script into Infragistics async postback</a></li><li><a href="http://CodeCorner.galanter.net/2011/03/03/run-javascript-from-both-full-and-partial-asp-net-postback/" rel="bookmark" class="crp_title">Run JavaScript from both full and partial ASP.NET postback</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/11/08/clientscript-registerstartupscript-script-injected-but-not-executed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to load IFRAMEs in order according to priority</title>
		<link>http://CodeCorner.galanter.net/2011/11/02/how-to-load-iframes-in-order-according-to-priority/</link>
		<comments>http://CodeCorner.galanter.net/2011/11/02/how-to-load-iframes-in-order-according-to-priority/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 21:14:32 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1466</guid>
		<description><![CDATA[Let&#8217;s say you have a Web page that displays &#8220;widgets&#8221; a small islands of information. And internally those widgets are IFRAME elements, whose source is loaded dynamically from the same server at runtime in client side JavaScript. So, you have a code similar to this: This (oversimplified) code assumes that URL for IFRAME source already [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a Web page that displays &#8220;widgets&#8221; a small islands of information. And internally those widgets are IFRAME elements, whose source is loaded dynamically from the same server at runtime in client side JavaScript. So, you have a code similar to this:</p>
<pre class="brush: jscript; title: ; notranslate">var aIframes = document.getElementsByTagName('IFRAME');
for (var I = 0; I &lt; aIframes.length; I++) {
    aIframes[I].src = aIframes[I].getAttribute('originalURL')
}</pre>
<p>This (oversimplified) code assumes that URL for IFRAME source already stored as a custom attribute <em>&#8216;originalURL&#8217;</em> of IFRAME element (for example placed there by server-side code), but it can equally come from other sources. This approach is usually taken so IFRAMES can initially display a static page with <em>&#8220;Please wait. Loading&#8230;&#8221;</em> animation meanwhile dynamically loading real data &#8211; creates a better user experience.</p>
<p>The code loops thru all IFRAMEs setting their SRC attribute, displaying content, so you would see something like</p>
<p><img src="http://kitchen.galanter.net/sitepic/iframe_widgets.png" alt="IFRAME widgets" /></p>
<p>It&#8217;s all well and good, but there&#8217;s a small problem. SRC of IFRAMEs is assigned in order of their appearance on the page and if URLs are pointing to the same server and one of the earlier IFRAMEs takes a long time to load &#8211; it will block the rest of the IFRAMEs from loading.<span id="more-1466"></span></p>
<p>This is happening because browser can only have a limited number of open connections to the server, it&#8217;s especially apparent in Internet Explorer which only has 2. But even the rest of them can quickly run out of open connections keeping the user waiting &#8211; which is especially frustrating if you know that some of those IFRAMEs only take fraction of a second to load &#8211; still they will have to wait till early ones finish loading.</p>
<p>The solution is not to assign URL right away but add all the IFRAME elements to an array, sort that array and assign URL to IFRAMEs while looping thru sorted array. Allow me to elaborate.</p>
<p>Let&#8217;s assume that every IFRAME element has another custom attribute called <em>&#8216;priority&#8217;</em>, which, again, can be assigned by many means &#8211; including server-side code. <em>&#8216;priority&#8217;</em> attribute is a number (1,2,3&#8230;) indicating IFRAME load priority (the lower the number the higher the priority). Let&#8217;s modify the code above a little:</p>
<pre class="brush: jscript; title: ; notranslate">var aIframes = document.getElementsByTagName('IFRAME');
var aIframeArray = new Array();

for (var I = 0; I &lt; aIframes.length; I++) {
    aIframeArray.push(aIframes[I])
}

aIframeArray.sort(function (a, b)
                   { return a.getAttribute('priority') - b.getAttribute('priority') })

for (var I = 0; I &lt; aIframeArray.length; I++) {
    aIframeArray[I].src = aIframeArray[I].getAttribute('originalURL')
}
</pre>
<ul>
<li><em>Line 02</em> creates a new array to hold IFRAME elements.</li>
<li><em>Lines 04-06</em> loop thru IFRAME elements, adding them to that array.</li>
<li><em>Lines 08-09</em> sort that array. Note how you can sort array of objects by object property by passing a custom comparasion function (Thanks <a href="http://www.webdotdev.com/nvd/content/view/878/" title="Javascript Sorting an Array of Objects" target="_blank">Larry Gomez</a> for this neat trick!).</li>
<li><em>Lines 11-13</em> loop thru sorted-by-priority array, giving SRC proprty of IFRAME elements their URL.</li>
</ul>
<p>Final result: IFRAMEs with higher priority (lower <em>&#8216;priority&#8217;</em> attribute number) get their SRC set first thus loading faster leaving slower IFRAMES to load last.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2009/09/30/resize-iframe-after-content-has-been-resized/" rel="bookmark" class="crp_title">Resize IFRAME after content has been resized</a></li><li><a href="http://CodeCorner.galanter.net/2009/07/10/webdialogwindow-removing-iframe-border-in-ie/" rel="bookmark" class="crp_title">WebDialogWindow &#8211; removing IFRAME border in IE</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/11/02/how-to-load-iframes-in-order-according-to-priority/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebHierarchicalDataGrid: Extra Row after Update</title>
		<link>http://CodeCorner.galanter.net/2011/10/12/webhierarchicaldatagrid-extra-row-after-update/</link>
		<comments>http://CodeCorner.galanter.net/2011/10/12/webhierarchicaldatagrid-extra-row-after-update/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 20:40:47 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[3rd party]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[New Stuff]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[style]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1447</guid>
		<description><![CDATA[If after upgrading to a new version of Infragistics NetAdvantage you suddenly found your WHDG sprouting an extra blank row on top: most likely it&#8217;s because grid&#8217;s ItemCssClass property is used. In theory (at least according to ever so verbose documentation) it should define what grid&#8217;s cells look like. In practice it have no effect [...]]]></description>
			<content:encoded><![CDATA[<p>If after <a href="http://codecorner.galanter.net/?s=Upgrade+Infragistics+11.1">upgrading to a new version of Infragistics NetAdvantage</a> you suddenly found your WHDG sprouting an extra blank row on top:</p>
<p><img src="http://kitchen.galanter.net/sitepic/whdg_extra_row.png" alt="Extra Row in Aikido WHDG" /></p>
<p>most likely it&#8217;s because grid&#8217;s <strong>ItemCssClass</strong> property is used. In theory (at least according to ever so verbose documentation) it should define what grid&#8217;s cells look like. In practice it have no effect whatsoever. Or rather had no effect until upgrade (verified in version 2011.1, perhaps even earlier). Now if your CSS class used in this property contains <strong>HEIGHT</strong> attribute &#8211; a blank row of that height will be inserted on top of the grid.</p>
<p>Solution? Remove <strong>ItemCssClass</strong> property. It&#8217;s useless anyway.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2011/10/10/webdatamenu-incorrect-displaying-after-upgrade/" rel="bookmark" class="crp_title">WebDataMenu: Incorrect displaying after upgrade</a></li><li><a href="http://CodeCorner.galanter.net/2011/10/05/webhierarchicaldatagrid-javascript-errors-after-upgrade/" rel="bookmark" class="crp_title">WebHierarchicalDataGrid: JavaScript errors after upgrade</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/10/12/webhierarchicaldatagrid-extra-row-after-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebDataMenu: Incorrect displaying after upgrade</title>
		<link>http://CodeCorner.galanter.net/2011/10/10/webdatamenu-incorrect-displaying-after-upgrade/</link>
		<comments>http://CodeCorner.galanter.net/2011/10/10/webdatamenu-incorrect-displaying-after-upgrade/#comments</comments>
		<pubDate>Mon, 10 Oct 2011 13:55:05 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[3rd party]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[New Stuff]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1436</guid>
		<description><![CDATA[This is the second post in saga titled Upgrading Infragistics Controls to a new version. Chances are that your WebDataMenu looks weird after upgrade to 2010+ version. In my case the menu had following options/features: It was a context popup menu, called on right mouse click Text of menu items was assigned dynamically at runtime [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second post in saga titled <a href="http://codecorner.galanter.net/?s=Upgrade+Infragistics+11.1">Upgrading Infragistics Controls to a new version</a>. Chances are that your WebDataMenu looks weird after upgrade to 2010+ version. In my case the menu had following options/features:</p>
<ul>
<li>It was a context popup menu, called on right mouse click</li>
<li>Text of menu items was assigned dynamically at runtime in JavaScript Client code</li>
</ul>
<p>After upgrading NetAdvantage from version 2009.2 to 2011.1 strange things started to happen. Text of the menu items was cut short, submenues appeared at wrong places it looked like something from a Dali&#8217;s painting.<br />
Numerous experiments later I found out that the problem was with <strong>EnableScrolling</strong> property of the menu control. Setting it to <strong>False</strong> returned menu to realm of realism.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2009/07/21/infragistics-webdatamenu-expanding-context-menu-up/" rel="bookmark" class="crp_title">Infragistics WebDataMenu: Expanding context menu UP</a></li><li><a href="http://CodeCorner.galanter.net/2011/02/24/infragistics-webdatamenu-csom-additemremoveitem-workaround/" rel="bookmark" class="crp_title">Infragistics WebDataMenu CSOM addItem/removeItem workaround</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/10/10/webdatamenu-incorrect-displaying-after-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WebHierarchicalDataGrid: JavaScript errors after upgrade</title>
		<link>http://CodeCorner.galanter.net/2011/10/05/webhierarchicaldatagrid-javascript-errors-after-upgrade/</link>
		<comments>http://CodeCorner.galanter.net/2011/10/05/webhierarchicaldatagrid-javascript-errors-after-upgrade/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 21:26:07 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[3rd party]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTML/CSS]]></category>
		<category><![CDATA[Infragistics]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1430</guid>
		<description><![CDATA[Upgrading 3rd party library to a new version is bound to have problems and Infragistics is no exception. In my case I was upgrading NetAdvantage for ASP.NET from version 2009.2 to to 20011.1 and right away WebHierarchicalDataGrid started to crash client-side. If ScriptManager was in debug mode I&#8217;d get error: Microsoft JScript runtime error: Sys.ArgumentUndefinedException: [...]]]></description>
			<content:encoded><![CDATA[<p>Upgrading 3rd party library to a new version is bound to have problems and Infragistics is no exception. In my case I was upgrading NetAdvantage for ASP.NET from version 2009.2 to to 20011.1 and right away WebHierarchicalDataGrid started to crash client-side. If ScriptManager was in debug mode I&#8217;d get error:</p>
<p><span style="color: #ff0000"><em>Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.Parameter name: type</em></span></p>
<p>With ScriptManager in Release mode it&#8217;d be:</p>
<p><span style="color: #ff0000"><em>Microsoft JScript runtime error: Object expected</em></span></p>
<p>But always in <em>Sys.Component.Create</em> &#8211; it looked like grid&#8217;s client-side scripts weren&#8217;t loading at all. After A LOT of digging I found out that the culprit was grid&#8217;s server-side <strong>Bands.Clear()</strong> method. When called, it caused client-side WHDG JavaScript <strong>not to load</strong>. When that method was commented &#8211; JavaScript errors disappeared. So until Infragistics comes out with a bug fix &#8211; if you experience similar problem, try to avoid <strong>Bands.Clear()</strong> method.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2008/08/21/infragistics-ultrawebgrid-grouping-in-code-problem-solved/" rel="bookmark" class="crp_title">Infragistics UltraWebGrid grouping in code problem (solved)</a></li><li><a href="http://CodeCorner.galanter.net/2011/10/10/webdatamenu-incorrect-displaying-after-upgrade/" rel="bookmark" class="crp_title">WebDataMenu: Incorrect displaying after upgrade</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/10/05/webhierarchicaldatagrid-javascript-errors-after-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE8: Display borders around empty cells</title>
		<link>http://CodeCorner.galanter.net/2011/09/26/ie8-display-borders-around-empty-cells/</link>
		<comments>http://CodeCorner.galanter.net/2011/09/26/ie8-display-borders-around-empty-cells/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 15:52:34 +0000</pubDate>
		<dc:creator>Yuriy</dc:creator>
				<category><![CDATA[HTML/CSS]]></category>

		<guid isPermaLink="false">http://CodeCorner.galanter.net/?p=1412</guid>
		<description><![CDATA[By default Internet Explorer 8 does not display blank cells in HTML tables (technically it does&#8217;t show borders around such cells) and visuals aren&#8217;t pretty. The solution below may not work for everybody, but I&#8217;d imagine will help in many cases: Just set the table style to Presto-chango! Missing borders now appear. Related Posts:Selectively change [...]]]></description>
			<content:encoded><![CDATA[<p>By default Internet Explorer 8 does not display blank cells in HTML tables (technically it does&#8217;t show borders around such cells) and visuals aren&#8217;t pretty. The solution below may not work for everybody, but I&#8217;d imagine will help in many cases:</p>
<p>Just set the table style to </p>
<pre class="brush: css; title: ; notranslate">border-collapse:collapse</pre>
<p>Presto-chango! Missing borders now appear.</p>
<div id="crp_related"><h4>Related Posts:</h4><ul><li><a href="http://CodeCorner.galanter.net/2010/04/20/selectively-change-cell-type-in-infragistics-ultrawebgrid/" rel="bookmark" class="crp_title">Selectively change cell type in Infragistics UltraWebGrid</a></li><li><a href="http://CodeCorner.galanter.net/2009/07/10/webdialogwindow-removing-iframe-border-in-ie/" rel="bookmark" class="crp_title">WebDialogWindow &#8211; removing IFRAME border in IE</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://CodeCorner.galanter.net/2011/09/26/ie8-display-borders-around-empty-cells/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

