<?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>Alec Tang</title>
	<atom:link href="http://www.alectang.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.alectang.com</link>
	<description>Professional Workspace &#38; Portfolio in Web 2.0 Development &#38; Project Management</description>
	<lastBuildDate>Fri, 19 Jun 2009 01:39:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Check if method is overridable</title>
		<link>http://www.alectang.com/2009/06/18/check-if-method-is-overridable/</link>
		<comments>http://www.alectang.com/2009/06/18/check-if-method-is-overridable/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 01:39:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET C#]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=174</guid>
		<description><![CDATA[For a method or properties to be overridable, it must has a virtual property in its base class set as true as well, is final must be set as true.
To determine whether a method is overridable, it is not sufficient to check  that IsVirtual is true. For a method to be overridable, IsVirtual must [...]]]></description>
			<content:encoded><![CDATA[<p>For a method or properties to be overridable, it must has a virtual property in its base class set as true as well, is final must be set as true.</p>
<p>To determine whether a method is overridable, it is not sufficient to check  that <strong><span><span>IsVirtual</span></span> is </strong><span><span><strong>true</strong></span></span>. For a method to be overridable, <span><span>IsVirtual</span></span> must be <span><span>true</span></span> and <strong><span>IsFinal</span> must be <span><span>false</span></span></strong>. For example, a method that  is non-virtual might implement an interface method.</p>
<p>The common language runtime  requires all methods that implement interface members to be marked as  <span><span>virtual</span></span>; therefore, the compiler marks the  method <span><span>virtual final</span></span>. Thus there are cases  where a method that is marked as <span><span>virtual</span></span> is not overridable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/06/18/check-if-method-is-overridable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to connect ASP.NET app to use MySQL</title>
		<link>http://www.alectang.com/2009/06/17/how-to-connect-asp-net-app-to-use-mysql/</link>
		<comments>http://www.alectang.com/2009/06/17/how-to-connect-asp-net-app-to-use-mysql/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 07:24:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET C#]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=172</guid>
		<description><![CDATA[A very easy way to connect ASP.NET application to use MySQL database is to use the MySQL Net Connector. With just the following lines of code, you can easily hookup your ASP.NET application to any MySQL db.
  public static string GetConnectionString()
        {
            string connStr = String.Format(&#8221;server=hostname;user id=dbname; password=password;database=dbname; pooling=false&#8221;, &#8220;hostname&#8221;, &#8220;dbname&#8221;, &#8220;password&#8221;);
                return connStr;
            }
        [...]]]></description>
			<content:encoded><![CDATA[<p>A very easy way to connect ASP.NET application to use MySQL database is to use the <a href="http://dev.mysql.com/downloads/connector/net/5.0.html" target="_blank">MySQL Net Connector</a>. With just the following lines of code, you can easily hookup your ASP.NET application to any MySQL db.</p>
<p>  public static string GetConnectionString()<br />
        {</p>
<p>            string connStr = String.Format(&#8221;server=hostname;user id=dbname; password=password;database=dbname; pooling=false&#8221;, &#8220;hostname&#8221;, &#8220;dbname&#8221;, &#8220;password&#8221;);<br />
                return connStr;<br />
            }</p>
<p>        protected void btnProceed_OnClick(object sender, EventArgs e)<br />
        {<br />
            MySql.Data.MySqlClient.MySqlConnection mycon = new MySqlConnection(GetConnectionString());<br />
            if (mycon.State != ConnectionState.Open)<br />
            {<br />
                try<br />
                {<br />
                    mycon.Open();<br />
                    string strQuery = &#8220;select * from table&#8221;;<br />
                    MySqlDataAdapter adapter = new MySqlDataAdapter(strQuery, mycon);<br />
                    DataSet myDataSet = new DataSet();<br />
                    adapter.Fill(myDataSet, &#8220;mytable&#8221;);<br />
                }<br />
                catch (MySqlException ex)<br />
                {<br />
                    throw (ex);<br />
                }<br />
            }</p>
<p>        }</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/06/17/how-to-connect-asp-net-app-to-use-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Firefox show fonts nicely as Internet Explorers</title>
		<link>http://www.alectang.com/2009/05/28/make-firefox-show-fonts-nicely-as-internet-explorers/</link>
		<comments>http://www.alectang.com/2009/05/28/make-firefox-show-fonts-nicely-as-internet-explorers/#comments</comments>
		<pubDate>Fri, 29 May 2009 03:03:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=167</guid>
		<description><![CDATA[I found something very interesting to know this morning, that is Firefox&#8217;s always shown fonts in web page a little differently than IE browsers. IE tends to show fonts more smooth and nice. There&#8217;s actually a way to change the settings so that Firefox could show fonts and lines more nicely like Internet Explorer. To [...]]]></description>
			<content:encoded><![CDATA[<p>I found something very interesting to know this morning, that is Firefox&#8217;s always shown fonts in web page a little differently than IE browsers. IE tends to show fonts more smooth and nice. There&#8217;s actually a way to change the settings so that Firefox could show fonts and lines more nicely like Internet Explorer. To do that,</p>
<p>1. Right click on Desktop and Go Properties<br />
2. Go to Appearance tab, click on Effects<br />
3. Notice the checked line, use the following method to smooth edges of screen fonts, make sure you choose ClearType instead of Standard.</p>
<p>Try again and Firefox now shows fonts nicely as IE!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/05/28/make-firefox-show-fonts-nicely-as-internet-explorers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ajaxify a page with usercontrols using delegate</title>
		<link>http://www.alectang.com/2009/05/26/ajaxify-a-page-with-usercontrols-using-delegate/</link>
		<comments>http://www.alectang.com/2009/05/26/ajaxify-a-page-with-usercontrols-using-delegate/#comments</comments>
		<pubDate>Wed, 27 May 2009 05:29:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET C#]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=163</guid>
		<description><![CDATA[This post points out how to ajaxify a page, which contains a usercontrol that is updatable by user. Whenever the usercontrol&#8217;s controls are updated, we will use Ajax to catch that updates and display at parent page. This is doable and it just requires a delegate to be registered in the usercontrol page.
First, in the [...]]]></description>
			<content:encoded><![CDATA[<p>This post points out how to ajaxify a page, which contains a usercontrol that is updatable by user. Whenever the usercontrol&#8217;s controls are updated, we will use Ajax to catch that updates and display at parent page. This is doable and it just requires a delegate to be registered in the usercontrol page.</p>
<p>First, in the usercontrol, we need to:<br />
1. Register a delegate object:</p>
<p>public delegate void userControlChangedHandler(object sender, EventArgs e);</p>
<p>public event userControlChangedHandler userControlChanged;</p>
<p>Then, we also implement a method that will run when subscribers get notified by the delegate.</p>
<p> protected virtual void updateProperties(object sender, EventArgs e){</p>
<p>//update usercontrol properties&#8230;<br />
if (userControlChanged != null)<br />
    userControlChanged(this, e);</p>
<p>}</p>
<p>and in the parent page, all we need to do is put this in page_init</p>
<p>userControl.userControlChanged += new userControlChangedHandler(aParentMethod);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/05/26/ajaxify-a-page-with-usercontrols-using-delegate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Australia safest to be in economy crisis</title>
		<link>http://www.alectang.com/2009/05/26/australia-safest-to-be-in-economy-crisis/</link>
		<comments>http://www.alectang.com/2009/05/26/australia-safest-to-be-in-economy-crisis/#comments</comments>
		<pubDate>Tue, 26 May 2009 23:36:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=161</guid>
		<description><![CDATA[A very interesting news article today saying that Australia happens to be the safest country in the world throughout the economy downturn. Coming along, China and Singapore ranked 2nd and third space respectively. Wow, that&#8217;s pretty impressive.
http://www.news.com.au/business/story/0,27753,25545056-462,00.html
]]></description>
			<content:encoded><![CDATA[<p>A very interesting news article today saying that Australia happens to be the safest country in the world throughout the economy downturn. Coming along, China and Singapore ranked 2nd and third space respectively. Wow, that&#8217;s pretty impressive.</p>
<p><a href="http://www.news.com.au/business/story/0,27753,25545056-462,00.html">http://www.news.com.au/business/story/0,27753,25545056-462,00.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/05/26/australia-safest-to-be-in-economy-crisis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Security Exception when running on IIS7</title>
		<link>http://www.alectang.com/2009/05/24/security-exception-when-running-on-iis7/</link>
		<comments>http://www.alectang.com/2009/05/24/security-exception-when-running-on-iis7/#comments</comments>
		<pubDate>Mon, 25 May 2009 00:25:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IIS7]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=157</guid>
		<description><![CDATA[I stumbled upon an error when deploying a web application onto IIS7 running on Vista. After days of trying to solve, it&#8217;s actually due to the fact that the application is set to medium trust but it actually needs Full Trust due to using Reflection in the code. There&#8217;s not much to do unless the [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon an error when deploying a web application onto IIS7 running on Vista. After days of trying to solve, it&#8217;s actually due to the fact that the application is set to medium trust but it actually needs Full Trust due to using Reflection in the code. There&#8217;s not much to do unless the hosting provider allow me to change the trust level but apparently it seems like this is not possible. They&#8217;re still trying to find out what they can do&#8230;</p>
<p>In the mean time, there&#8217;s a good Wiki post here <a href="http://www.fbwiki.com/index.php?title=PartialTrustIssue">http://www.fbwiki.com/index.php?title=PartialTrustIssue</a> which explains the problem.</p>
<p>Update:</p>
<p>Apparently, it&#8217;s because my application is using Data Access Application Block, which requires use of the full trust security level. Applying patch 2554 to the source allows applications to run under partial trust scenarios, for example, in a hosted ASP.NET environment. To solve that, download this:</p>
<p><a href="http://www.codeplex.com/entlib/Release/ProjectReleases.aspx?ReleaseId=1339">http://www.codeplex.com/entlib/Release/ProjectReleases.aspx?ReleaseId=1339</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/05/24/security-exception-when-running-on-iis7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compress WebResource.axd in Client side HTML</title>
		<link>http://www.alectang.com/2009/05/11/compress-webresourceaxd-in-client-side-html/</link>
		<comments>http://www.alectang.com/2009/05/11/compress-webresourceaxd-in-client-side-html/#comments</comments>
		<pubDate>Tue, 12 May 2009 02:51:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET C#]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=153</guid>
		<description><![CDATA[A very handy tool to compress the annoying webresources.axd script.
http://madskristensen.net/post/Compress-WebResourceaxd-in-ASPNET.aspx
]]></description>
			<content:encoded><![CDATA[<p>A very handy tool to compress the annoying webresources.axd script.</p>
<p>http://madskristensen.net/post/Compress-WebResourceaxd-in-ASPNET.aspx</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/05/11/compress-webresourceaxd-in-client-side-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wild Wild Adelaide</title>
		<link>http://www.alectang.com/2009/04/28/wild-wild-adelaide/</link>
		<comments>http://www.alectang.com/2009/04/28/wild-wild-adelaide/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 23:16:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adelaide]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=150</guid>
		<description><![CDATA[Saw some photos showcasting the wild weather of South Australia, for those who are thinking of coming to SA to work.





]]></description>
			<content:encoded><![CDATA[<p>Saw some photos showcasting the wild weather of South Australia, for those who are thinking of coming to SA to work.</p>
<p><img src="http://www.alectang.com/wp-content/uploads/2009/04/image001.jpg" alt="image001" title="image001" width="650" height="450" class="alignnone size-full wp-image-147" /></p>
<p><span id="more-150"></span></p>
<p><img src="http://www.alectang.com/wp-content/uploads/2009/04/image002.jpg" alt="image002" title="image002" width="650" height="450" class="alignnone size-full wp-image-148" /></p>
<p><img src="http://www.alectang.com/wp-content/uploads/2009/04/image004.jpg" alt="image004" title="image004" width="650" height="450" class="alignnone size-full wp-image-149" /></p>
<p><img src="http://www.alectang.com/wp-content/uploads/2009/04/image005.jpg" alt="image005" title="image005" width="650" height="450" class="alignnone size-full wp-image-151" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/04/28/wild-wild-adelaide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Radio Button problems in a repeater item template</title>
		<link>http://www.alectang.com/2009/04/26/radio-button-problems-in-a-repeater-item-template/</link>
		<comments>http://www.alectang.com/2009/04/26/radio-button-problems-in-a-repeater-item-template/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 00:15:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ASP.NET C#]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=145</guid>
		<description><![CDATA[When using radio button in a repeater item template, there&#8217;s a problem of grouping them to a unique name. Solution can be found:
http://www.developer.com/net/asp/article.php/3623096
]]></description>
			<content:encoded><![CDATA[<p>When using radio button in a repeater item template, there&#8217;s a problem of grouping them to a unique name. Solution can be found:</p>
<p>http://www.developer.com/net/asp/article.php/3623096</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/04/26/radio-button-problems-in-a-repeater-item-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Regular Expression for validating Australian phone numbers</title>
		<link>http://www.alectang.com/2009/04/23/regular-expression-for-validating-australian-phone-numbers/</link>
		<comments>http://www.alectang.com/2009/04/23/regular-expression-for-validating-australian-phone-numbers/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 05:24:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Regular Expressions]]></category>

		<guid isPermaLink="false">http://www.alectang.com/?p=143</guid>
		<description><![CDATA[A very useful regular expression for validation Australian wide phone number, including mobile phones. This would accepts all forms of Australian phone numbers in different formats (area code in brackets, no area code, spaces between 2-3 and 6-7th digits, +61 international dialing code). Checks that area codes are valid (when entered).
^\({0,1}((0&#124;\+61)(2&#124;4&#124;3&#124;7&#124;8)){0,1}\){0,1}(\ &#124;-){0,1}[0-9]{2}(\ &#124;-){0,1}[0-9]{2}(\ &#124;-){0,1}[0-9]{1}(\ &#124;-){0,1}[0-9]{3}$
]]></description>
			<content:encoded><![CDATA[<p>A very useful regular expression for validation Australian wide phone number, including mobile phones. This would accepts all forms of Australian phone numbers in different formats (area code in brackets, no area code, spaces between 2-3 and 6-7th digits, +61 international dialing code). Checks that area codes are valid (when entered).</p>
<p>^\({0,1}((0|\+61)(2|4|3|7|8)){0,1}\){0,1}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{2}(\ |-){0,1}[0-9]{1}(\ |-){0,1}[0-9]{3}$</p>
]]></content:encoded>
			<wfw:commentRss>http://www.alectang.com/2009/04/23/regular-expression-for-validating-australian-phone-numbers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
