<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Asp.Net 2.0</title>
        <link>http://geekswithblogs.net/chrishan/category/2134.aspx</link>
        <description>Asp.Net 2.0</description>
        <language>en-US</language>
        <copyright>Chris Han</copyright>
        <managingEditor>chrishan2000@hotmail.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Timeout Asp.net - What could possibly go wrong?</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/07/18/114030.aspx</link>
            <description>&lt;div style="MARGIN: 0in 0in 0pt"&gt;I've been through almost all sorts of Timeout related issues with Asp.net web service development. I’d like put a check list here to remind myself and hopefully save some headache of yours. &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;
&lt;ol&gt;
    &lt;li&gt;If use database, you may get ‘&lt;a title="Title of this entry." href="http://geekswithblogs.net/chrishan/archive/2007/06/28/113536.aspx"&gt;&lt;font color="#000080"&gt;System.Data.SqlClient.SqlException: Timeout expired&lt;/font&gt;&lt;/a&gt;’:&lt;br /&gt;
          a: Check your connection string setting for ‘Connect Timeout’:  I.e.&lt;br /&gt;
    connectionString="Data Source=SNYC14D11511;Initial Catalog=d_dbivt003;Persist Security Info=True;User ID= user;Password= Password;&lt;font style="BACKGROUND-COLOR: #ffff00"&gt;Connect Timeout=4200&lt;br /&gt;
    &lt;/font&gt;&lt;br /&gt;
          b:Check your command object  &lt;font style="BACKGROUND-COLOR: #ffff00"&gt;SqlCommand.CommandTimeout&lt;/font&gt; Property, it’s by default 30s &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Check you Web.config setting when you get error like ‘Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.’:&lt;br /&gt;
    &amp;lt;system.web&amp;gt;….&lt;br /&gt;
    &amp;lt;compilation debug="false"/&amp;gt;&lt;br /&gt;
    &amp;lt;httpRuntime &lt;font style="BACKGROUND-COLOR: #ffff00"&gt;executionTimeout="1200"/&lt;/font&gt;&amp;gt;&lt;br /&gt;
    &amp;lt;/system.web&amp;gt;&lt;br /&gt;
    make sure your set 'compilation debug="false" as well to let timeout setting take effect. Check MSDN for details.&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Set your proxy class Timeout property (derived from WebClientProtocol.Timeout Property) at client if you get error like this ‘The operation has timed out’: I.e.&lt;br /&gt;
    proxy.&lt;font style="BACKGROUND-COLOR: #ffff00"&gt;Timeout &lt;/font&gt;= System.Threading.Timeout.Infinite;&lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;If you are like me, use VistualStudio unit test tool and you get a blue icon and error ‘Timeout’ in your test result pane, you need to check your test config file &lt;font style="BACKGROUND-COLOR: #ffff00"&gt;localtestrun.testrunconfig&lt;/font&gt;. The last item ‘Test Timeouts’ is the key. It’s 5 min by default. &lt;br /&gt;
    &lt;/li&gt;
    &lt;li&gt;Last one and every web developer should know is the IIS server setting such as Keep Alive and Connection Timeout&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114030"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114030" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/114030.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/07/18/114030.aspx</guid>
            <pubDate>Wed, 18 Jul 2007 20:50:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/114030.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/07/18/114030.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/114030.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/114030.aspx</trackback:ping>
        </item>
        <item>
            <title>Visual Studio 2005 error : Unable to start program xxx when trying to debug or View in Browser</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/06/13/113195.aspx</link>
            <description>&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 8pt"&gt;I have to admit that I never read any manual or document for Visual Studio. Part of blame should go to MS engineers who design such a consistent UI that I can pick it up without any learning curve with past experience.&lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 8pt"&gt;But this also creates a problem when there is a new element introduced in the newer version without a proper warning on the consequence. That is what happened to me. &lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt; &lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 8pt"&gt;If you right click an Aspx file in Solution Explorer, you will see an item called &lt;strong&gt;“Browse With” &lt;/strong&gt;in the context menu. &lt;/span&gt;&lt;/div&gt;
&lt;div style="MARGIN: 0in 0in 0pt"&gt;&lt;span style="FONT-SIZE: 8pt"&gt;I added Altova’s XML Spy to display the XHTML generated by Server side. But I forgot to set the “Default” back to IE after that. The consequence is that every time I try to F5 debug or View in Browser, Visual Studio will load the XmlSpy to display the XHTML generated by Server side instead of load it IE.&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113195"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113195" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/113195.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/06/13/113195.aspx</guid>
            <pubDate>Wed, 13 Jun 2007 14:01:35 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/113195.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/06/13/113195.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/113195.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/113195.aspx</trackback:ping>
        </item>
        <item>
            <title>Google TiSP - A joke for who?</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/04/01/110533.aspx</link>
            <description>&lt;P&gt;I have to&amp;nbsp;admit that the first sight I&amp;nbsp;laid on this link &lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#ff0000&gt;New!&lt;/FONT&gt; Get FREE breakthrough broadband with &lt;/FONT&gt;&lt;A onmousedown="return clk(this.href,'promos','hppweb:en_extra','pro','1','')" href="http://www.google.com/tisp/"&gt;&lt;FONT size=2&gt;Google TiSP (BETA)&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;under the big G's search box, I was so excited.&amp;nbsp;Not only because it's FREE, but the word "breakthrough" which caught my breath. After 20 ms reading the link &lt;A href="http://www.google.com/tisp/install.html"&gt;How TiSP Works&lt;/A&gt;, I can only regret for the end of the once-a-inovision-hero. &lt;/P&gt;
&lt;P&gt;I like the sense of hummer google presented here, but what I'd really like to see&amp;nbsp;is&amp;nbsp;a real respectful technology breakthrough&amp;nbsp;rather than a cheap joke.&amp;nbsp;I hope google won't become another Apple.&amp;nbsp;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=110533"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=110533" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/110533.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/04/01/110533.aspx</guid>
            <pubDate>Sun, 01 Apr 2007 17:11:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/110533.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/04/01/110533.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/110533.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/110533.aspx</trackback:ping>
        </item>
        <item>
            <title>Dynamically Loaded Control can not maintain values at PostBack?</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/03/27/109988.aspx</link>
            <description>&lt;FONT size=2&gt;
&lt;P&gt;&lt;FONT size=3&gt;I was trying to create and page with Asp.NET 2.0 and &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:City w:st="on"&gt;&lt;st1:place w:st="on"&gt;Ajax&lt;/st1:place&gt;&lt;/st1:City&gt; 1.0.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;I was using a placeholder control to dynamically load a user control based on the user selection. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;The first error I encountered is :&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;{"Failed to load viewstate.&amp;nbsp; The control tree into which viewstate is being loaded must match the control tree &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;that was used to save viewstate during the previous request.&amp;nbsp; For example, when adding controls dynamically, the &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;controls added during a post-back must match the type and position of the controls added during the initial &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;request."}&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;This is because I'm suppose to load the same user control on every page request, not only in (!IsPostBack) block. I&amp;nbsp;solved that by&amp;nbsp;moving the loading code to Page's &lt;/FONT&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;OnInit &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;FONT size=3&gt;event handler. According to MSDN article, &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic4"&gt;&lt;FONT color=#000080 size=3&gt;http://msdn2.microsoft.com/en-us/library/ms972976.aspx#viewstate_topic4&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=3&gt;, here is the time when the page can load all of it's child controls before restore their viewstates.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;After that, everything looks fine except that I can't get the value I entered into the dynamically loaded user control when post back! To make it more interesting, when keep the same user control loaded (don't load other user controls), I enter the value again, and click submit again, boom! You got it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=3&gt;What could be wrong? After a day of scratching head and debugging, I notice that every time I load&amp;nbsp;a different&amp;nbsp;control, the loaded user control's ID is randomly assigned such as 'ctl26'. So I &lt;/FONT&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;explicitly &lt;/SPAN&gt;&lt;FONT size=3&gt;specify the ID before load it:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #2b91af"&gt;Control&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt; ctl = LoadControl(ControlPath);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;ctl.ID = &lt;SPAN style="COLOR: #a31515"&gt;"UcSecuritySubTypeDetails"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;placeHolderSecuritySubTypeDetails.Controls.Add(ctl);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;Now everything works together. So the keys of using dynamically loaded control is:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;1. Load it every time.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;2. Give it an explicit ID&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;One thing I need to clarify is that initially I was loading the dynamic control in &lt;FONT size=2&gt;Page_PreInit event handler as suggested by the MSDN article: &lt;A href="http://msdn2.microsoft.com/en-us/library/ms178472(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms178472(VS.80).aspx&lt;/A&gt;. It says PreInit event is typically used for "Create or re-create dynamic controls". But if do as such, I will get an error complaining that the object of my placeholder control is not yet instantiated. &amp;nbsp;That is because although Page is derived from Control class, but at Page_PreInit stage of the Asp.NET life cycle, only Page object is created, all sub-controls include the placeholder are initiated after Page_PreInit and before Page_Init. Check Alex Arkhipov's nice post here for details of Asp.NET 2.0 Page life cycle:&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;A href="http://blogs.vertigosoftware.com/alexark/archive/2005/05/06/898.aspx"&gt;http://blogs.vertigosoftware.com/alexark/archive/2005/05/06/898.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;Page_Init is the best place you can load the dynamic controls into a parent control other than the Page.&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=109988"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=109988" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/109988.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/03/27/109988.aspx</guid>
            <pubDate>Tue, 27 Mar 2007 14:01:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/109988.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/03/27/109988.aspx#feedback</comments>
            <slash:comments>10</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/109988.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/109988.aspx</trackback:ping>
        </item>
        <item>
            <title>Asp.net 2.0 StyleSheetTheme works in design time but doesn't work at runtime?</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/03/08/108270.aspx</link>
            <description>&lt;P&gt;In Asp.Net 2.0, you can use StyleSheetTheme in stead of Theme setting to enable design time style in VS IDE. &lt;/P&gt;
&lt;P&gt;Just make sure you close and reopen the page every time you change the setting. But one day, I encounter this problem: My style setting show up nicely in design time, but disappear when I run the page. By reading this article: &lt;A href="http://www.odetocode.com/articles/423.aspx"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;http://www.odetocode.com/articles/423.aspx&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt; , I fund that my stylesheet didn't being injected in to the generated HTML at all. As the matter of fact, the whole &amp;lt;head&amp;gt; tage is missing. When I check back my code, I fund that there is a attribute in my &amp;lt;head&amp;gt; - "&lt;FONT color=#ff0000 size=2&gt;visible&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;="false". &lt;/FONT&gt;Once I turn it back to "true", everything works like charm.&lt;/P&gt;
&lt;P&gt;You can read Scott's article here: &lt;A href="http://weblogs.asp.net/scottgu/archive/2006/03/24/Access-to-a-page_2700_s-head-element-using-ASP.NET-2.0.aspx"&gt;&lt;U&gt;&lt;FONT color=#0000ff&gt;http://weblogs.asp.net/scottgu/archive/2006/03/24/Access-to-a-page_2700_s-head-element-using-ASP.NET-2.0.aspx&lt;/U&gt;&lt;/FONT&gt;&lt;/A&gt; for more fun playing with header programmatically.&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000 size=3&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108270"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108270" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/108270.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/03/08/108270.aspx</guid>
            <pubDate>Thu, 08 Mar 2007 13:56:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/108270.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/03/08/108270.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/108270.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/108270.aspx</trackback:ping>
        </item>
        <item>
            <title>AJAX Tutorials: Where is SurveyQuestions.xml? </title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/03/07/108196.aspx</link>
            <description>&lt;P&gt;While I'm walking&amp;nbsp;through the new Asp.net AJAX extension tutorials, one of the example under topic &lt;A href="http://ajax.asp.net/docs/tutorials/UsingUpdatePanelControls.aspx"&gt;Using the UpdatePanel Control with Data-Bound Controls &lt;/A&gt;really catch me. It shows how easy you can create an dynamic survey page with an content XML source. I remembered that back in 2002, how hard I was trying to create such implementation by using xslt and xmldocument class. At that time, java world has a server side solution called 'cocoon'. The basic idea is to translate XML to HTML using a xsl sheet. The key is this is done on server side not in browser. At the time only IE support that.&lt;/P&gt;
&lt;P&gt;Wthi ASP.NET 2.0&amp;nbsp;XMLDataSource control, everything become so easy! This is the link to that example.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://ajax.asp.net/docs/Samples/UpdatePanelHowTo6/cs/SurveyQuestionsExample.aspx"&gt;http://ajax.asp.net/docs/Samples/UpdatePanelHowTo6/cs/SurveyQuestionsExample.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Unfortunately, the source XML file is missing, I couldn't find the link to down load it from Asp.net site. So I created this file myself by looking through the code. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://geekswithblogs.net/chrishan/articles/108195.aspx"&gt;Here is the link to schema and sample XML file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108196"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=108196" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/108196.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/03/07/108196.aspx</guid>
            <pubDate>Wed, 07 Mar 2007 14:25:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/108196.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/03/07/108196.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/108196.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/108196.aspx</trackback:ping>
        </item>
        <item>
            <title>SqlDependency attribute for OutputCache directive is invalid</title>
            <link>http://geekswithblogs.net/chrishan/archive/2007/01/11/103370.aspx</link>
            <description>&lt;P&gt;I was trying out the SQL cache dependency feature that Asp.net 2.0 provided. I got this error after I configure the application properly with this config section:&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515"&gt;system.web&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515"&gt;caching&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515"&gt;sqlCacheDependency&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;enabled&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt"&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;databases&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;add&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;connectionStringName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;p_dbivt001ConnectionString&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; =&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;p_dbivt001ConnectionString&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;pollTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;1000&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;databases&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;sqlCacheDependency&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;caching&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;system.web&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;After a further reading, I realized that I haven't run the &lt;STRONG&gt;aspnet_regsql&lt;/STRONG&gt; command line tool to enable the database for dependency check: &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: #3333ff"&gt;aspnet_regsql -S servername -U username -d DatabaseName -ed -et -t TableName&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: black"&gt;Microsoft document says you can use either aspnet_regsql command line tool or &lt;STRONG&gt;SqlCacheDependencyAdmin.EnableNotifications&lt;/STRONG&gt; to programmatically turn on the SQL dependency. I didn't success with the later though.&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: black"&gt;This tool will create the infrastructure to&amp;nbsp;record any changes on the table you specified. There will be a trigger added that table you wish to depend on. The trigger will call a stored procedure AspNet_SqlCacheUpdateChangeIdStoredProcedure(created by the tool) to record the changes you made on a table. Another worker procedure AspNet_SqlCachePollingStoredProcedure will be called from asp.net application to&amp;nbsp;poll those changes. &lt;/SPAN&gt;The &lt;SPAN style="COLOR: red"&gt;pollTime&lt;/SPAN&gt; attribute specifies the interval in milliseconds&amp;nbsp;with minimum 500.&lt;/P&gt;
&lt;P&gt;One thing bothers me is the triggers added by the &lt;STRONG&gt;aspnet_regsql&lt;/STRONG&gt; command line tool don't have any exception handling structure by default. That means your changes to the host tables will be roll back if the trigger or any processes underneath for SQL dependency failed. Sometimes,&amp;nbsp;this is not what we want, isn't it? Fortunately with&amp;nbsp;SQL server 2K5, we can&amp;nbsp;add a try-catch block and force it to commit in catch block, here is the modified trigger:&lt;o:p&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;ALTER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;TRIGGER&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt; [dbo]&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt;[dbo.BM_UDFLookupDataSetValue_AspNet_SqlCacheNotification_Trigger] &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;ON&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt; [dbo]&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black"&gt;[BM_UDFLookupDataSetValue]&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;FOR INSERT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt; UPDATE&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;,&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt; DELETE AS BEGIN&lt;BR&gt;SET &lt;?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" /&gt;&lt;st1:place w:st="on"&gt;&lt;st1:City w:st="on"&gt;NOCOUNT&lt;/st1:City&gt; &lt;st1:State w:st="on"&gt;ON&lt;/st1:State&gt;&lt;/st1:place&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;BEGIN TRY&lt;BR&gt;EXEC dbo&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;AspNet_SqlCacheUpdateChangeIdStoredProcedure N&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red"&gt;'dbo.BM_UDFLookupDataSetValue'&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;END TRY&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;BEGIN CATCH&lt;BR&gt;IF &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: fuchsia"&gt;@@TRANCOUNT&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt; 0&lt;BR&gt;COMMIT TRANSACTION&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;END CATCH&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray"&gt;;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue"&gt;END&lt;/SPAN&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=103370"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=103370" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/103370.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2007/01/11/103370.aspx</guid>
            <pubDate>Thu, 11 Jan 2007 13:42:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/103370.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2007/01/11/103370.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/103370.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/103370.aspx</trackback:ping>
        </item>
        <item>
            <title>Sweet AppendDataBoundItems Property for Asp.NET 2.0 Drop Down Control</title>
            <link>http://geekswithblogs.net/chrishan/archive/2006/04/25/76330.aspx</link>
            <description>&lt;P&gt;In a master-detail type of page, you will alway be asked to add a item called &amp;#8220;New Item&amp;#8221;&amp;nbsp;at the top of&amp;nbsp;a master drop down list so that the user select this &amp;#8220;New Item&amp;#8221; to set the detail pane to &amp;#8220;Insert&amp;#8221; mode.&lt;/P&gt;
&lt;P&gt;The traditional way is after you data bound the drop down list, you add a new ListItem to the drop down list. But not any more with Asp.NET 2.0 drop down list control!&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#000000&gt;Scott Gu&lt;/FONT&gt;&amp;nbsp;has this post explains it in details: &lt;A href="http://weblogs.asp.net/scottgu/archive/2006/01/29/436804.aspx"&gt;http://weblogs.asp.net/scottgu/archive/2006/01/29/436804.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What I would like to add is when you add that &amp;#8220;New Item&amp;#8221; with Vs.NET 2005, by default, it add an item&amp;nbsp;in this format:&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;asp&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;ListItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;New Item&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;/&lt; SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;asp&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;ListItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;This could cause trouble when &amp;#8220;detail&amp;#8221; data source use this control as the Data Key field because it doesn't has a value field. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;The work around is to manully&amp;nbsp;add this item then, no big deal huh?:&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;asp&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;ListItem&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="New Item"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=""&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;Not so fast! Vs.NET 2005 has a small neat freak habit- it will remove the tag&amp;nbsp;&lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="" &lt;FONT face="Times New Roman" color=#000000 size=3&gt;if its value is an empty string. So you have to make it something else like &lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="-1"&amp;nbsp;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;otherwise the &amp;#8220;detail&amp;#8221; data source will throw an exception: &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;Input string was not in a correct format.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Times New Roman" color=#000000 size=3&gt;So what's&amp;nbsp;the good looking&amp;nbsp;for a developer like you:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;&lt;FONT size=+0&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT size=2&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;asp&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: maroon"&gt;ListItem&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: red"&gt;Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="New Item"&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="-1"&lt;/SPAN&gt;&lt;FONT color=#000000&gt; &lt;/FONT&gt;&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#000000&gt;Oh, last thing: make sure you turn off the Viewstate for the drop down control. I can't tell you any more details about this. Otherwise there's no fun any more left for you. Try it yourself.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000 size=3&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76330"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=76330" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/76330.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2006/04/25/76330.aspx</guid>
            <pubDate>Tue, 25 Apr 2006 13:15:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/76330.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2006/04/25/76330.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/76330.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/76330.aspx</trackback:ping>
        </item>
        <item>
            <title>ASP.NET tab doest show up in IIS virtual directory property page after install asp.net 2.0 framework</title>
            <link>http://geekswithblogs.net/chrishan/archive/2006/03/29/73707.aspx</link>
            <description>&lt;P&gt;I install the Asp.NET 2.0 framework on a WinXp pro box. When I bring up the property page of a virtual directory, for some reason, I can't see the ASP.NET tab where you can config the asp.net version to either 1.1 or 2.0&lt;/P&gt;
&lt;P&gt;&lt;IMG src="/images/geekswithblogs_net/chrishan/4283/o_apsnetTab.gif"&gt;&lt;/IMG&gt;&lt;/P&gt;
&lt;P&gt;So I have to use the ASP.NET IIS Registration Tool (Aspnet_regiis.exe)&amp;nbsp;to config my virtual directory to use asp.net 2.0 framework!&lt;/P&gt;
&lt;P&gt;The MSDN article&amp;nbsp;is&amp;nbsp;a pretty good help on this issue:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/k6h9cz8h.aspx"&gt;http://msdn2.microsoft.com/en-us/library/k6h9cz8h.aspx&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=73707"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=73707" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/73707.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2006/03/29/73707.aspx</guid>
            <pubDate>Wed, 29 Mar 2006 11:50:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/73707.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2006/03/29/73707.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/73707.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/73707.aspx</trackback:ping>
        </item>
        <item>
            <title>Installing SQL Server database used by the ASP.NET 2.0 Membership and Profile providers</title>
            <link>http://geekswithblogs.net/chrishan/archive/2006/01/02/64681.aspx</link>
            <description>&lt;P&gt;I'd like to keep this link at my finger tip since I keep forgetting it:&lt;/P&gt;
&lt;P&gt;To run the Aspnet_regsql.exe wizard, run Aspnet_regsql.exe without any command line arguments, as shown in the following example:&lt;/P&gt;
&lt;P&gt;&lt;TT&gt;C:\WINDOWS\Microsoft.NET\Framework\&lt;VERSIONNUMBER&gt;\&lt;/TT&gt;&lt;TT&gt;aspnet_regsql.exe -E -S localhost &lt;B&gt;-d &lt;/B&gt;&lt;I&gt;database &lt;/I&gt;-A all&lt;/TT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/library/x28wfk74(en-us,vs.80).aspx"&gt;http://msdn2.microsoft.com/library/x28wfk74(en-us,vs.80).aspx&lt;/A&gt;&lt;/P&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=64681"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=64681" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/chrishan/aggbug/64681.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Chris Han</dc:creator>
            <guid>http://geekswithblogs.net/chrishan/archive/2006/01/02/64681.aspx</guid>
            <pubDate>Mon, 02 Jan 2006 20:46:00 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/chrishan/comments/64681.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/chrishan/archive/2006/01/02/64681.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/chrishan/comments/commentRss/64681.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/chrishan/services/trackbacks/64681.aspx</trackback:ping>
        </item>
    </channel>
</rss>