<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.oateck.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Programming Tips By Omar AlBadri</title><link>http://www.oateck.com/blogs/programming_tips/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Better Php Caching</title><link>http://www.oateck.com/blogs/programming_tips/archive/2008/02/19/php-caching-for-high-traffic-sites.aspx</link><pubDate>Tue, 19 Feb 2008 23:36:00 GMT</pubDate><guid isPermaLink="false">c6a5d946-b9d9-4e5f-964a-3d03c2bbe558:38</guid><dc:creator>Omar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.oateck.com/blogs/programming_tips/rsscomments.aspx?PostID=38</wfw:commentRss><comments>http://www.oateck.com/blogs/programming_tips/archive/2008/02/19/php-caching-for-high-traffic-sites.aspx#comments</comments><description>I read many interesting articles on caching that all do the job. The problem I have with most of the techniques is that they do not show you how to implement caching for High Traffic sites. Let look at what caching is first What is Caching? Most web sites...(&lt;a href="http://www.oateck.com/blogs/programming_tips/archive/2008/02/19/php-caching-for-high-traffic-sites.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.oateck.com/aggbug.aspx?PostID=38" width="1" height="1"&gt;</description><category domain="http://www.oateck.com/blogs/programming_tips/archive/tags/better+php+caching/default.aspx">better php caching</category></item><item><title>Data Integration using a MultiThreading Kernel</title><link>http://www.oateck.com/blogs/programming_tips/archive/2008/02/05/data-integration-using-a-multithreading-kernel.aspx</link><pubDate>Tue, 05 Feb 2008 18:39:00 GMT</pubDate><guid isPermaLink="false">c6a5d946-b9d9-4e5f-964a-3d03c2bbe558:32</guid><dc:creator>Omar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.oateck.com/blogs/programming_tips/rsscomments.aspx?PostID=32</wfw:commentRss><comments>http://www.oateck.com/blogs/programming_tips/archive/2008/02/05/data-integration-using-a-multithreading-kernel.aspx#comments</comments><description>Sometimes you have a problem where two incompatable system, (such as a POS/ Cash Register) , needs to integrate with a new software systems (such as a new website) data. The issue is that the POS system is the Master of Inventroy (MOI) and needs to update...(&lt;a href="http://www.oateck.com/blogs/programming_tips/archive/2008/02/05/data-integration-using-a-multithreading-kernel.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://www.oateck.com/aggbug.aspx?PostID=32" width="1" height="1"&gt;</description><category domain="http://www.oateck.com/blogs/programming_tips/archive/tags/Data+Integration+MultiThreading+Kernel/default.aspx">Data Integration MultiThreading Kernel</category></item><item><title>Cross Browser Development Tips and Tricks </title><link>http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx</link><pubDate>Wed, 23 Jan 2008 16:59:00 GMT</pubDate><guid isPermaLink="false">c6a5d946-b9d9-4e5f-964a-3d03c2bbe558:29</guid><dc:creator>Omar</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.oateck.com/blogs/programming_tips/rsscomments.aspx?PostID=29</wfw:commentRss><comments>http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx#comments</comments><description>&lt;blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;a class="" href="http://www.oateck.com/images/blog/ie6ie7.jpg" target="_blank"&gt;&lt;/a&gt;IE6! IE7!&amp;nbsp; Safari!&amp;nbsp; Opera! FireFox! OH MY!!! Developing for today multiple browsers can be a nightmare. In this article I go over some tips and some general guidelines on how to make Cross Browser Development as easy as possible.&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="5"&gt;&lt;strong&gt;Overview&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#000000" size="3"&gt;If we look at the market share of today&amp;#39;s browsers for the last year we get something like this:&lt;/font&gt;&lt;/p&gt;
&lt;table class="gentable" class="gentable"&gt;

&lt;tr&gt;
&lt;td class=""&gt;&lt;b&gt;IE&lt;/b&gt;&lt;/td&gt;
&lt;td class=""&gt;Internet Explorer&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&lt;b&gt;Fx&lt;/b&gt;&lt;/td&gt;
&lt;td class=""&gt;Firefox &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&lt;b&gt;Moz&lt;/b&gt;&lt;/td&gt;
&lt;td class=""&gt;The Mozilla Suite (Gecko, Netscape)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&lt;b&gt;S&lt;/b&gt;&lt;/td&gt;
&lt;td class=""&gt;Safari &lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&lt;b&gt;O&lt;/b&gt;&lt;/td&gt;
&lt;td class=""&gt;Opera&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;h2&gt;Browser Statistics Month by Month&lt;/h2&gt;
&lt;table class="gentable" cellspacing="0" class="gentable"&gt;

&lt;tr&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;2007&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;IE7&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;IE6&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;IE5&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;Fx&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;Moz&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;S&lt;/b&gt;&lt;/td&gt;
&lt;td class="" style="BACKGROUND-COLOR:#c0c0c0;"&gt;&lt;b&gt;O&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;December&lt;/td&gt;
&lt;td class=""&gt;21.0%&lt;/td&gt;
&lt;td class=""&gt;33.2%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;36.3%&lt;/td&gt;
&lt;td class=""&gt;1.4%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;1.4%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;November&lt;/td&gt;
&lt;td class=""&gt;20.8%&lt;/td&gt;
&lt;td class=""&gt;33.6%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;
&lt;td class=""&gt;36.3%&lt;/td&gt;
&lt;td class=""&gt;1.2%&lt;/td&gt;
&lt;td class=""&gt;1.8%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;October&lt;/td&gt;
&lt;td class=""&gt;20.7%&lt;/td&gt;
&lt;td class=""&gt;34.5%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;36.0%&lt;/td&gt;
&lt;td class=""&gt;1.3%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;September&lt;/td&gt;
&lt;td class=""&gt;20.8%&lt;/td&gt;
&lt;td class=""&gt;34.9%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;35.4%&lt;/td&gt;
&lt;td class=""&gt;1.2%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;August&lt;/td&gt;
&lt;td class=""&gt;20.5%&lt;/td&gt;
&lt;td class=""&gt;35.7%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;34.9%&lt;/td&gt;
&lt;td class=""&gt;1.3%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;July&lt;/td&gt;
&lt;td class=""&gt;20.1%&lt;/td&gt;
&lt;td class=""&gt;36.9%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;34.5%&lt;/td&gt;
&lt;td class=""&gt;1.4%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.9%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;June&lt;/td&gt;
&lt;td class=""&gt;19.7%&lt;/td&gt;
&lt;td class=""&gt;37.3%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;34.0%&lt;/td&gt;
&lt;td class=""&gt;1.4%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.8%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;May&lt;/td&gt;
&lt;td class=""&gt;19.2%&lt;/td&gt;
&lt;td class=""&gt;38.1%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;
&lt;td class=""&gt;33.7%&lt;/td&gt;
&lt;td class=""&gt;1.3%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;April&lt;/td&gt;
&lt;td class=""&gt;19.1%&lt;/td&gt;
&lt;td class=""&gt;38.4%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;32.9%&lt;/td&gt;
&lt;td class=""&gt;1.3%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;March&lt;/td&gt;
&lt;td class=""&gt;18.0%&lt;/td&gt;
&lt;td class=""&gt;38.7%&lt;/td&gt;
&lt;td class=""&gt;2.0%&lt;/td&gt;
&lt;td class=""&gt;31.8%&lt;/td&gt;
&lt;td class=""&gt;1.3%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;
&lt;td class=""&gt;1.6%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;February&lt;/td&gt;
&lt;td class=""&gt;16.4%&lt;/td&gt;
&lt;td class=""&gt;39.8%&lt;/td&gt;
&lt;td class=""&gt;2.5%&lt;/td&gt;
&lt;td class=""&gt;31.2%&lt;/td&gt;
&lt;td class=""&gt;1.4%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;January&lt;/td&gt;
&lt;td class=""&gt;13.3%&lt;/td&gt;
&lt;td class=""&gt;42.3%&lt;/td&gt;
&lt;td class=""&gt;3.0%&lt;/td&gt;
&lt;td class=""&gt;31.0%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;
&lt;td class=""&gt;1.7%&lt;/td&gt;
&lt;td class=""&gt;1.5%&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;
&lt;td class=""&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;p&gt;&lt;font size="3"&gt;A couple of things that we can conclude from this chart:&lt;/font&gt;&lt;/p&gt;&lt;font size="3"&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;IE 6 is still the number one browser(avg over 12 months)&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;We can ignore Opera and Mozilla as there market share is either decreasing or staying at the low end&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;IE7 is gaining ground&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;FireFox is getting hugely popular&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;While Safari is not that large of a market share Mac users are begining to embrace it AND a windows version was just released.&lt;br /&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;So how does one begin development when there are so many browsers out there? &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;Here are some tips some rules and some hacks that can make you life easier:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;strong&gt;1. Download the Latest Version of Firefox, Safari and Upgrade to IE7.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;font color="#000000"&gt;On your development system you should have the latest FireFox,&amp;nbsp;Safari(for Mac users) and IE7.&amp;nbsp;IE7 is going to get the most complaints from developers but it is essential that you upgrade because IE7 is gaining&amp;nbsp;ground and IE6 is slowly dying(yay!!).&amp;nbsp;Having these three browsers(plus I will&amp;nbsp;show a way to get IE6 on your&amp;nbsp;machine too, more on that later) will make sure that you see is what over 90%&amp;nbsp;or more of the internet will also see.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;/font&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;strong&gt;2. Download Microsoft Virtual PC for IE6 Development&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;font color="#000000"&gt;Like&amp;nbsp;I said before, you can&amp;nbsp;work with both IE7 and IE6 on the same system its just that you&amp;nbsp;have to run IE6 on a virtual PC. Luckily for us Microsoft offers a free version of virtual PC that represent Windows Xp with IE6 running on it. Downloading and installing that will allow you to have IE7 on&amp;nbsp;your main environment and IE6&amp;nbsp;via virtual PC!!&amp;nbsp;Click on the link below to get Virtual PC. Click on the screen shot to see IE6 and IE7 working side by side:&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;font color="#000000"&gt;&lt;img height="1" alt="" src="http://www.oateck.com/images/blog/ie6ie7.jpg" width="1" align="middle" border="0" /&gt;&lt;img height="1" alt="" src="http://www.oateck.com/images/blog/ie6ie7.jpg" width="1" align="middle" border="0" /&gt;&lt;a class="" href="http://www.oateck.com/images/blog/ie6ie7_lg.jpg" target="_blank"&gt;&lt;img height="400" alt="" src="http://www.oateck.com/images/blog/ie6ie7.jpg" width="680" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a class="" title="Get MS V PC" href="http://www.microsoft.com/windows/products/winfamily/virtualpc/default.mspx" target="_blank"&gt;Get Microsoft Virtual PC&lt;/a&gt;&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#99cc00"&gt;&lt;a class="" href="http://www.oateck.com/images/blog/ie6ie7.jpg" target="_blank"&gt;&lt;/a&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#99cc00" size="3"&gt;&lt;strong&gt;3. Download Firebug(FireFox) and Web Developer(FireFox) and IE Developer Toolbar(IE6 and IE7)&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#000000" size="3"&gt;Firebug is the most important add on because it allows you to adjust the css live then change your templates as you make changes. IE Developer Toolbar allows you to inspect elements in IE7 and IE6 but you can not make live edits. Still they will Greatly help you in solving CSS and alignment issues.&lt;br /&gt;Get them Here:&lt;br /&gt;&lt;a class="" href="https://addons.mozilla.org/en-US/firefox/addon/60" target="_blank"&gt;Web Developer(FF)&lt;/a&gt;&lt;br /&gt;&lt;a class="" href="https://addons.mozilla.org/en-US/firefox/addon/1843" target="_blank"&gt;FireBug(FF)&lt;/a&gt;&lt;br /&gt;&lt;a class="" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;amp;displaylang=en" target="_blank"&gt;IE Developer Toolbar&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Tahoma" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#99cc00" size="3"&gt;&lt;strong&gt;4. Always Develop for FireFox/Safari First...&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" size="3"&gt;Firefox has the greatest amount of tools to develop with. Safari will render almost exactly like Firefox so developing for one should be compatible with the other. The second reason is that there are plenty of Hacks and workarounds for IE that are not available for FireFox.&lt;br /&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#99cc00" size="3"&gt;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#99cc00" size="3"&gt;&lt;strong&gt;5. ... Then Develop for IE6 and IE7&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#000000" size="3"&gt;After you finish developing for FF you can now begin your IE6 and IE7 development. I suggest you start with IE7 then IE6. The reason being is that IE6 will run slowly in the Virtual PC so you only want to make final adjustments using...&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;strong&gt;6. Use Conditional statement for IE6 and IE7&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;font color="#000000"&gt;After you completed your developement in FireFox and you bring up your page in IE6/7 you should notice some style differences. Using Conditional statements to load other CSS stylesheet for IE7/6 will keep your CSS valid and since conditional statements only work in IE, it will isolate IE. To do this&amp;nbsp;add a second and third Stylesheet called IE7.css and IE6.css and load them after you main stylesheet.. In these style sheets you should overwrite any style that are not working in Firefox. Here is how the Stylesheet should be set up in your&amp;lt;head&amp;gt; tag&lt;br /&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;font color="#000000"&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;head&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;link&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;rel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;text/css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;href&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;StyleSheet.css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;lt;!--[if IE 7]&amp;gt;&lt;br /&gt;&amp;lt;&lt;font color="#a31515" size="2"&gt;link&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;rel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;text/css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;href&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;IE7.css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;lt;!--[if IE 6]&amp;gt;&lt;br /&gt;&amp;lt;&lt;font color="#a31515" size="2"&gt;link&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;rel&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;stylesheet&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;type&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;text/css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="2"&gt;href&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;=&amp;quot;IE6.css&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;/&amp;gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;lt;![endif]--&amp;gt;&lt;br /&gt;&lt;/font&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;head&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt; &lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;br /&gt;&lt;/font&gt;&lt;font face="Tahoma" color="#99cc00" size="3"&gt;&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" color="#008000" size="3"&gt;
&lt;p&gt;&lt;font color="#99cc00"&gt;&lt;strong&gt;7. Only use hacks as a last resort ... and if you do use them separate them out &lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font color="#000000"&gt;There comes a point where the clock is ticking and you need the website done yesterday. While I don&amp;#39;t condone using hacks some times it is a necessity to get something to work in all browser. If you do use hacks follow these two rules&lt;/font&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;font color="#000000"&gt;Separate the hacks from the main styling &lt;/font&gt;&lt;/li&gt;
&lt;li&gt;&lt;font color="#000000"&gt;Use cascading hacks and label them&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;font color="#000000"&gt;For example you have a class called table width. In Firefox it looks good but in IE7 its too wide and in IE 6 its too short. Here is a diagram of how the hacks work.&lt;br /&gt;&lt;br /&gt;Since you coded for FireFox you should not need to hack it.&lt;br /&gt;&lt;br /&gt;If you want a style to only be seen by IE7 and IE6 place a &lt;strong&gt;#&lt;/strong&gt; in front of the style&lt;br /&gt;&lt;br /&gt;For IE6 only place a &lt;strong&gt;_&lt;/strong&gt; in front of the style.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#000000"&gt;So if your main styling code for a class tablewidth looks like his:&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;
&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;nbsp;.&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;tablewidth&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color:black;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding:0px 5px 3px 2px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; width:532px;&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;font face="Tahoma" size="3"&gt;remove the problematic style&amp;nbsp; and create a new section below the original:&lt;/font&gt;&lt;/p&gt;&lt;font face="Tahoma" size="3"&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;nbsp;.&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="2"&gt;tablewidth&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; color:black;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; padding:0px 5px 3px 2px;&lt;br /&gt;&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;
&lt;blockquote&gt;&lt;font face="Tahoma"&gt;/*Hacks for tablewidth class*/&lt;br /&gt;&lt;/font&gt;&lt;font face="Tahoma"&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="2"&gt;&amp;nbsp;.&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="2"&gt;tablewidth&lt;br /&gt;{&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;nbsp;&amp;nbsp; width:532px;&amp;nbsp; /*Firefox/Safari will read this*/&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;strong&gt;#&lt;/strong&gt;width:530px; /*IE7 and IE6 can only see this &amp;nbsp;*/&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;strong&gt;_&lt;/strong&gt;width:520; /*Only IE6 can read this */&lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;Coding the style sheets in this way will make you code much more readable and make you hacks easier to find and remove if you solve the problem or rework using conditional statements &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;&lt;br /&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;I hope you find this article useful, please feel free to leave me comments and questions&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;font face="Tahoma" size="3"&gt;&lt;/font&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;;subject=Cross+Browser+Development+Tips+and+Tricks+" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;;title=Cross+Browser+Development+Tips+and+Tricks+" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;Bookmark to Del.icio.us!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;title=Cross+Browser+Development+Tips+and+Tricks+" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;;title=Cross+Browser+Development+Tips+and+Tricks+" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx&amp;amp;;title=Cross+Browser+Development+Tips+and+Tricks+&amp;amp;;top=1" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/23/cross-browser-development.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.oateck.com/aggbug.aspx?PostID=29" width="1" height="1"&gt;</description><category domain="http://www.oateck.com/blogs/programming_tips/archive/tags/Cross+Browser+Development+Tips+and+Tricks++developing+for+IE+and+Firefox/default.aspx">Cross Browser Development Tips and Tricks  developing for IE and Firefox</category></item><item><title>Top 5 programming languages you should know in 2008</title><link>http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx</link><pubDate>Tue, 15 Jan 2008 20:16:00 GMT</pubDate><guid isPermaLink="false">c6a5d946-b9d9-4e5f-964a-3d03c2bbe558:19</guid><dc:creator>Omar</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.oateck.com/blogs/programming_tips/rsscomments.aspx?PostID=19</wfw:commentRss><comments>http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx#comments</comments><description>&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;Programming languages, run the web. I am always asked &amp;quot;Which programming language is the best to learn?&amp;quot; to which I counter &amp;quot; If you only know one, then your in serious trouble.&amp;quot; This got me thinking on what programming languages should a programmer know to maximize his talent and marketability. Below is the top five languages that every programmer should know:&lt;/font&gt;&lt;/p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;img style="FLOAT:left;" height="150" alt="" src="http://www.oateck.com/images/blog/rails-podcast.png" width="150" border="0" /&gt; &lt;/font&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;u&gt;&lt;br /&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&amp;nbsp;5. Ruby on Rails&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/u&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;Why you should learn it: &lt;/font&gt;&lt;/strong&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;Cause it is the future. If you want to build a website writing only 8 lines of code Ruby on Rails(RoR) is the language for you. There has always been talk of Object Oriented Programming(OOP) and Ruby on Rails is OOP in its purest form.&lt;br /&gt;&lt;strong&gt;Why it is number 5: &lt;/strong&gt;Cause it is still in infancy and it does not have a debugger or a true IDE. Also its has a STEEP learning curve and its hard to understand how each component is put together&lt;br /&gt;&lt;strong&gt;Resources: &lt;/strong&gt;&lt;a class="" title="Top 12 Ruby on Rails Tutorials" href="http://www.digitalmediaminute.com/article/1816/top-ruby-on-rails-tutorials" target="_blank"&gt;Top 12 Ruby on Rails Tutorials&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;strong&gt;&lt;u&gt;&lt;img style="FLOAT:left;" height="150" src="http://www.oateck.com/images/blog/mysql1.png" width="150" border="0" alt="" /&gt;&lt;br /&gt;&lt;img style="FLOAT:right;" height="150" alt="" src="http://www.oateck.com/images/blog/SqlServer2005.jpg" width="150" border="0" /&gt;4. MYSQL/Microsoft SQL(T-SQL)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;Why you should learn it: &lt;/strong&gt;Static pages are dead. Almost any reputable site has a database as a back end. The abilty to program Stored Procedures as well as simple task as creating a table,&amp;nbsp;is a MUST if you are to be a complete programmer. Whether its Sql Server or MySql it is imperative that you learn a&amp;nbsp;Structured&amp;nbsp; Query Language.&lt;br /&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;strong&gt;Why it is number 4: &lt;/strong&gt;In some cases you can get by, by not knowing a SQL language, in some companies they have dedicated Database programmer who will do the work for you. In general,especially in 08&amp;#39;&amp;nbsp;you need to know how some database programming.&lt;br /&gt;&lt;strong&gt;Resources: &lt;/strong&gt;&lt;a class="" href="http://www.tutorialguide.net/programming/mysql_programming/" target="_blank"&gt;Top Tutorial on Mysql&lt;/a&gt;,&amp;nbsp;&lt;a class="" title="MS SQL Tutorial" href="http://www.functionx.com/sqlserver/index.htm" target="_blank"&gt;Tutorial on&amp;nbsp;MS Sql&lt;/a&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;u&gt;
&lt;p&gt;&lt;br /&gt;&lt;img style="FLOAT:left;" height="150" alt="" src="http://www.oateck.com/images/blog/ajax.png" width="150" border="0" /&gt;3. JavaScript/AJAX&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;Why you should learn it: &lt;/strong&gt;Ajax (Asynchronous JavaScript and XML) is the new buzz word in the industry. Why I included JavaScript also is you can not do one with out knowing the other. Ajax in essence is a technique of updating &amp;quot;regions&amp;quot; on a web page instead of updating the page on a post back. Ajax is the future of web and every programmer should learn it for 2008&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font size="3"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;strong&gt;Why it is number 3: &lt;/strong&gt;Cause you cant program a web page in Ajax/JavaScript alone(at least not yet). You still need a underling technology that the web page runs on(LAMP,ASP.NET, etc). Ajax is&amp;nbsp;still a great&amp;nbsp;tool/method to create cool effects and functionality.&lt;br /&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;a class="" href="http://www.w3schools.com/ajax/default.asp" target="_blank"&gt;Tutorial on AJAX&lt;/a&gt;,&lt;a class="" href="http://www.w3schools.com/js/js_intro.asp" target="_blank"&gt;Tutorial on Javascript&lt;br /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font size="3"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;strong&gt;&lt;u&gt;&lt;img style="FLOAT:left;" height="150" alt="" src="http://www.oateck.com/images/blog/php.png" width="150" border="0" /&gt;2. PHP&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;Why you should learn it:&lt;/strong&gt;&amp;nbsp; The old master, PHP (which surprisingly stand for Personal Home Page) is still going strong. PHP in association with LAMP(Linux Apache MySql PHP) is a effective cheap and efficient way to program websites. You can have a entire infrastructure built of free cheap software. Many reputable businesses and large companies are now adopting LAMP as a standard. Not only that there is a wealth of CMS and Community&amp;nbsp;orientated software&amp;nbsp;that are available only for PHP(Drupal,Joombla). There are many availiable free library and a wealth of info avaliable for PHP.&lt;br /&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;font size="3"&gt;&lt;font face="tahoma,arial,helvetica,sans-serif"&gt;&lt;strong&gt;Why it is number 2: &lt;/strong&gt;Lack of standardization. Ask 4 different PHP programmer of a way to accomplish as task, and you might get 5 different answers. While debuggers and IDE&amp;#39;s do exist lack, of standardization hurts the&amp;nbsp;technology.&amp;nbsp;Overall you can create cheap, &lt;br /&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;a class="" href="http://www.w3schools.com/php/default.asp" target="_blank"&gt;PHP Tutorial&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;strong&gt;&lt;u&gt;&lt;img style="FLOAT:left;" height="150" alt="" src="http://www.oateck.com/images/blog/csharp.gif" width="150" border="0" /&gt;1. C#&lt;br /&gt;&lt;br /&gt;&lt;/u&gt;Why you should learn it: &lt;/strong&gt;Quite simple it simple, powerfully and extensible. Its&amp;nbsp;IDE(Visual Studio 2008) is second to none. You can easily create both web applications&amp;nbsp;and windows application with out learning a new language. Integrating with any database is easy and there are plenty of libraries and systems (Community Server) that use C#. Used in conjunction with ASP.Net C# can preform any task that any other languages can do WITH a better and usable interface.&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;br /&gt;&lt;strong&gt;Why it is Number 1: &lt;/strong&gt;Quite frankly its the easiest most extensible language out there. Some would say C# is nothing but a next generation VB. I disagree I think it is the next generation of C++ which was universally loved. C# programmers also tend to make the most in the job market.&lt;br /&gt;&lt;strong&gt;Resources: &lt;/strong&gt;&lt;a class="" href="http://www.programmingtutorials.com/csharp.aspx" target="_blank"&gt;C# Tutorials&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;font size="2"&gt;So take some time this year and learn something new. For me my goal is to improve my PHP skills. Please feel free to comment or email me with any questions.&lt;/font&gt;&lt;/font&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt; 
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font face="tahoma,arial,helvetica,sans-serif" size="3"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;;subject=Top+5+programming+languages+you+should+know+in+2008" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;;title=Top+5+programming+languages+you+should+know+in+2008" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;Bookmark to Del.icio.us!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;title=Top+5+programming+languages+you+should+know+in+2008" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;;title=Top+5+programming+languages+you+should+know+in+2008" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx&amp;amp;;title=Top+5+programming+languages+you+should+know+in+2008&amp;amp;;top=1" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/15/top-5-programming-languages-you-should-know.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.oateck.com/aggbug.aspx?PostID=19" width="1" height="1"&gt;</description><category domain="http://www.oateck.com/blogs/programming_tips/archive/tags/Top+5+programming+languages+you+should+know+in+2008+Ruby+on+rails+PHP+C_2300_+AJAX+javascript/default.aspx">Top 5 programming languages you should know in 2008 Ruby on rails PHP C# AJAX javascript</category></item><item><title>Adding a Confirm Javascript PopUp with a image to a ASP.NET GridView AND Update the database</title><link>http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx</link><pubDate>Thu, 10 Jan 2008 04:45:00 GMT</pubDate><guid isPermaLink="false">c6a5d946-b9d9-4e5f-964a-3d03c2bbe558:17</guid><dc:creator>Omar</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.oateck.com/blogs/programming_tips/rsscomments.aspx?PostID=17</wfw:commentRss><comments>http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx#comments</comments><description>&lt;p&gt;After hours of searching thru pages and pages of code I could not find a single example of code that did exactly what I wanted. Here is the scenario:&lt;/p&gt;
&lt;p&gt;I want a GridView in Asp.net to display a image that will fire some Javascript confirming that I want to delete the row. If I press &lt;strong&gt;OK&lt;/strong&gt; the a Asp.net function will fire that will delete the user. If I click cancel nothing will happen.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;So for everybody looking for this code I am going to show you EXACTLY how to do it step by step:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Setting up the GridView Control&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Create a new web site in Asp.net(or use a existing one) and drop in your Gridview Control&lt;/p&gt;
&lt;p&gt;2. Click on the Task icon and set up your datasource( in this example I am using the Northwind Database and accessing the customers table)&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;3. Add a Command field. I moved mine to the top.&lt;/p&gt;
&lt;p&gt;&lt;img height="417" alt="Add a command field" src="http://www.oateck.com/images/blog/commandfield.png" width="513" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;4. Set the &amp;quot;Show Delete Button&amp;quot; to true&lt;/p&gt;
&lt;p&gt;&lt;img height="193" alt="Set Show Delete Button to True" src="http://www.oateck.com/images/blog/showdeletebut.png" width="248" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;5. Press OK ( you can also set Show CancelButton to True) Now we need to setup a bounding event.&lt;/p&gt;
&lt;p&gt;6.Right Click on the GridView Control and choose Properties &lt;/p&gt;
&lt;p&gt;7. Click on the Events button(the lighting bolt) and double click on the &amp;quot;RowDataBound&amp;quot; event&lt;/p&gt;
&lt;p&gt;&lt;img height="1" alt="" src="http://www.oateck.com/images/blog/rowdatabound1.png" width="1" border="0" /&gt;&lt;img height="402" alt="" src="http://www.oateck.com/images/blog/rowdatabound1.png" width="272" border="0" /&gt;&lt;/p&gt;
&lt;p&gt;Now we are set up for code &lt;/p&gt;
&lt;p&gt;Lets overview what we want. Want some Javascript to be called with a &lt;strong&gt;OK&lt;/strong&gt; and &lt;strong&gt;Cancel&lt;/strong&gt; button and we want some sort of image representing the delete button. First we are going to find the delete control, and second we are going to cast it as a LinkButton(I will explain why shortly) and third we are going to add some JavaScript to confirm that we want to delete a customer:&lt;/p&gt;
&lt;p&gt;1. You should now be in the Code behind page and at the Function:&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; GridView1_RowDataBound(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;GridViewRowEventArgs&lt;/font&gt;&lt;font size="2"&gt; e) if not press F7 and find the function&lt;/font&gt;&lt;/p&gt;&lt;font size="2"&gt;2. First we find the control, then we cast it to a link button and then we use the &amp;quot;&lt;strong&gt;&lt;em&gt;OnClientClick&amp;quot; &lt;/em&gt;&lt;/strong&gt;property of the link button to set the JavaScript. Finally we use the &lt;strong&gt;&lt;em&gt;&amp;quot;Text&amp;quot; &lt;/em&gt;&lt;/strong&gt;property to add a image to the link button: Here is the code&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;font color="#0000ff" size="2"&gt; 
&lt;p&gt;if&lt;/font&gt;&lt;font size="2"&gt; (e.Row.RowType == &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;DataControlRowType&lt;/font&gt;&lt;font size="2"&gt;.DataRow)&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;LinkButton&lt;/font&gt;&lt;font size="2"&gt; deleteButton = (&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;LinkButton&lt;/font&gt;&lt;font size="2"&gt;)e.Row.Cells[0].Controls[2];&amp;nbsp; //&amp;lt;-- &lt;strong&gt;&lt;em&gt;we are casting control 2 my delete control link to a LinkButton&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;deleteButton.OnClientClick =&amp;nbsp;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;return confirm(&amp;#39;Delete this Record (&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; + ((&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;DataControlFieldCell&lt;/font&gt;&lt;font size="2"&gt;)e.Row.Cells[2]).Text + &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;)?&amp;#39;)&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;; // &amp;lt;-- &lt;strong&gt;&lt;em&gt;here we add the javascript on the onclick event&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;deleteButton.Text = &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&amp;lt;img src=\&amp;quot;icon_delete.gif\&amp;quot;/&amp;gt;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;; //&amp;lt;-- &lt;strong&gt;&lt;em&gt;finally we add the image to the text element&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;3. If we compile and run the code and look at the source we have the basis of what we want:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;lt;table cellspacing=&amp;quot;0&amp;quot; rules=&amp;quot;all&amp;quot; border=&amp;quot;1&amp;quot; id=&amp;quot;GridView1&amp;quot; style=&amp;quot;border-collapse:collapse;&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;tr&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;td&amp;gt;&amp;lt;a href=&amp;quot;doPostBack(&amp;#39;GridView1&amp;#39;,&amp;#39;Edit$0&amp;#39;)&amp;quot;&amp;gt;Edit&amp;lt;/a&amp;gt;&amp;amp;nbsp;&amp;lt;&lt;strong&gt;a onclick=&amp;quot;&lt;/strong&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;strong&gt;return confirm(&amp;#39;Delete this Record (Alfreds Futterkiste)?&amp;#39;);&amp;quot;&lt;/strong&gt; href=&amp;quot;doPostBack(&amp;#39;GridView1&amp;#39;,&amp;#39;Delete$0&amp;#39;&lt;strong&gt;)&amp;quot;&amp;gt;&amp;lt;img src=&amp;quot;icon_delete.gif&amp;quot;/&amp;gt;&lt;/strong&gt;&amp;lt;/a&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;ALFKI&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Alfreds Futterkiste&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Maria Anders&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Sales Representative&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Obere Str. 57&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Berlin&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;12209&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;Germany&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;030-0074321&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;030-0076545&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/tr&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;In the browser it looks like this:&lt;br /&gt;&lt;img height="71" alt="" src="http://www.oateck.com/images/blog/gridview.png" width="265" border="0" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;We now have a image button that pulls this up when clicked&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;img height="126" alt="Delete " src="http://www.oateck.com/images/blog/delete.png" width="269" border="0" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;strong&gt;&lt;u&gt;Updating the database&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;We have a Confirm delete pop up but now we need to have a way to update the database when the user presses &amp;quot;&lt;strong&gt;OK&lt;/strong&gt;&amp;quot; and do nothing if the user presses &amp;quot;Cancel&lt;/p&gt;
&lt;p&gt;1. Let go back to the Gridview and right click on it and select properties and go to the event tab again&lt;/p&gt;
&lt;p&gt;2.. Now Double click on the &amp;quot;RowCommand&amp;quot; Event &lt;/p&gt;
&lt;p&gt;&lt;img height="558" alt="" src="http://www.oateck.com/images/blog/rowcommand.png" width="272" border="0" /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;3. Now we need to find the row that was clicked and what command was called (NOTE: Remember I have a Cancel button as well as a delete button so it is useful to know what command was pressed) Here is the simple code:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;protected&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;void&lt;/font&gt;&lt;font size="2"&gt; GridView1_RowCommand1(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;object&lt;/font&gt;&lt;font size="2"&gt; sender, &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;GridViewCommandEventArgs&lt;/font&gt;&lt;font size="2"&gt; e)&lt;br /&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// get the row index stored in the CommandArgument property&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;int&lt;/font&gt;&lt;font size="2"&gt; index = &lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;Convert&lt;/font&gt;&lt;font size="2"&gt;.ToInt32(e.CommandArgument);&lt;br /&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;// find the command to execute&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; command = e.CommandName;&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;if&lt;/font&gt;&lt;font size="2"&gt; (command == &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;Delete&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;//call delete function&lt;br /&gt;&lt;/font&gt;&lt;font size="2"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;4. Now you can write your delete code&lt;/p&gt;
&lt;p&gt;Now you might ask &amp;quot;What happens if cancel is pressed?&amp;quot; remember we have a &lt;strong&gt;&lt;em&gt;return&amp;nbsp; &lt;/em&gt;&lt;/strong&gt;on the Javascript so if it returns &amp;quot;false&amp;quot; or cancel the RowCommand Event will never fire.&lt;/p&gt;
&lt;p&gt;I hope this post is helpful, please leave any comment or questions.&lt;/p&gt;
&lt;p&gt;Update: I added the code in the downloads page if you want to review the project. Get if from &lt;a class="" href="http://www.oateck.com/files"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;img height="1" alt="" src="http://www.oateck.com/images/blog/delet.png" width="1" border="0" /&gt;&lt;img height="1" alt="" src="http://www.oateck.com/images/blog/delete.png" width="1" border="0" /&gt;&lt;/font&gt;&lt;/p&gt;
&lt;div class = "shareblock"&gt;&lt;strong&gt;Share this post:&lt;/strong&gt; &lt;a href = "mailto:?body=Thought you might like this: http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;;subject=Adding+a+Confirm+Javascript+PopUp+with+a+image+to+a+ASP.NET+GridView+AND+Update+the+database" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;email it!&lt;/a&gt; |  &lt;a href = "http://del.icio.us/post?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;;title=Adding+a+Confirm+Javascript+PopUp+with+a+image+to+a+ASP.NET+GridView+AND+Update+the+database" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;Bookmark to Del.icio.us!&lt;/a&gt; |  &lt;a href = "http://www.digg.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;;phase=2" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;digg it!&lt;/a&gt; |  &lt;a href = "http://reddit.com/submit?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;title=Adding+a+Confirm+Javascript+PopUp+with+a+image+to+a+ASP.NET+GridView+AND+Update+the+database" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;reddit!&lt;/a&gt; |  &lt;a href = "http://www.dotnetkicks.com/submit/?url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;;title=Adding+a+Confirm+Javascript+PopUp+with+a+image+to+a+ASP.NET+GridView+AND+Update+the+database" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;kick it!&lt;/a&gt; |  &lt;a href = "https://favorites.live.com/quickadd.aspx?marklet=1&amp;amp;;mkt=en-us&amp;amp;;url=http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx&amp;amp;;title=Adding+a+Confirm+Javascript+PopUp+with+a+image+to+a+ASP.NET+GridView+AND+Update+the+database&amp;amp;;top=1" target="_blank" title = "Post http://www.oateck.com/blogs/programming_tips/archive/2008/01/09/adding-a-confirm-javascript-popup-to-a-asp-net-gridview-and-update-the-database.aspx"&gt;live it!&lt;/a&gt;&lt;/div&gt;&lt;img src="http://www.oateck.com/aggbug.aspx?PostID=17" width="1" height="1"&gt;</description><category domain="http://www.oateck.com/blogs/programming_tips/archive/tags/javascript+confirm+asp.net+gridview+image+javascript+popup/default.aspx">javascript confirm asp.net gridview image javascript popup</category></item></channel></rss>