<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Web.NET</title><link>http://blog.turlov.com/</link><description>It's all about using ASP.NET with AJAX, C# and Javascript in the most efficient way for building web applications for 2.0 era.</description><language>en</language><managingEditor>noreply@blogger.com (Alexander Turlov)</managingEditor><lastBuildDate>Tue, 10 Nov 2009 13:37:33 PST</lastBuildDate><generator>Blogger http://www.blogger.com</generator><openSearch:totalResults xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">32</openSearch:totalResults><openSearch:startIndex xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">1</openSearch:startIndex><openSearch:itemsPerPage xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/">25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Webnet" type="application/rss+xml" /><feedburner:emailServiceId>Webnet</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Talk about P&amp;P Web Client Software Factory on Toronto Architecture User Group meeting</title><link>http://feedproxy.google.com/~r/Webnet/~3/LXAj6ZIsT10/talk-about-p-web-client-software.html</link><category>Guidance Automation</category><category>WCSF</category><category>patterns and practices</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Thu, 08 Oct 2009 13:40:57 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-6382636590019952252</guid><description>Developing modular web applications is a popular topic in development communities especially after ASP.NET MVC framework has been introduced by Microsoft. However ASP.NET MVC is not the first and only framework that can help on that way.&lt;br /&gt; &lt;br /&gt;I'll be talking about building modular enterprise-class modern web applications with the help of &lt;a href="http://www.martinfowler.com/eaaDev/uiArchs.html#model-view-presentermvp"&gt;MVP design pattern&lt;/a&gt; and Microsoft Patterns and Practices &lt;a href="http://websf.codeplex.com/"&gt;Web Client Software Factory&lt;/a&gt; framework on the next meeting of &lt;a href="http://www.architectureug.com/"&gt;Toronto Architecture User Group&lt;/a&gt; on Thursday October 29th. To attend please &lt;a href="https://www.clicktoattend.com/invitation.aspx?code=142060"&gt;register online here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-6382636590019952252?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/LXAj6ZIsT10" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-10-08T16:40:57.905-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/10/talk-about-p-web-client-software.html</feedburner:origLink></item><item><title>Problem with Internet Explorer 8 Debugger on Windows 7</title><link>http://feedproxy.google.com/~r/Webnet/~3/TlybIlsAZDU/problem-with-internet-explorer-8.html</link><category>Internet browsers</category><category>Windows 7</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 23 Sep 2009 11:30:06 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-121603264159396581</guid><description>I continue to evaluate Windows 7 after upgrading from Windows Vista and share some experience (mostly bad of course, so people would not step on the same problem again). &lt;a href="http://blog.turlov.com/2009/09/how-to-map-iso-file-to-drive-in-windows.html"&gt;As I mentioned before&lt;/a&gt;, overall upgrade was smooth and mostly everything works OK. However time to time I stumble upon some really annoying problems that did not exist on Windows Vista and therefore need to be solved for Windows 7 from scratch.&lt;br /&gt;&lt;br /&gt;One of the recent problems was &lt;a href="http://blog.turlov.com/2009/09/how-to-map-iso-file-to-drive-in-windows.html"&gt;Daemon Tools not working on Windows 7&lt;/a&gt; and it was solved by installing Magic Disc. Now there is one more thing: after upgrading to Windows 7 I am not able to use IE8 Debugger. When I pressed F12 the Debugger icon appeared on the task bar but I can not switch to its window: it's not visible.&lt;br /&gt;&lt;br /&gt;So obviously I searched over the Internet and luckily there was one post on &lt;a href="http://stackoverflow.com/questions/960683/why-isnt-my-ie8-developer-tools-working"&gt;Stack Overflow&lt;/a&gt; (apart from those guessing about a window being outside of the screen) that suggested that there may be some wrong setting in Windows registry. And there are some registry keys related to IE8 debugger! So the solution was to &lt;span style="font-weight:bold;"&gt;remove WindowsPos, Pinned and UseDevToolsDebugger keys&lt;/span&gt; from the [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\IEDevTools] section. That completely solved the problem.&lt;br /&gt;&lt;br /&gt;Unfortunately I can not tell whether those keys existed in Windows Vista and were incompatible with Windows 7 or their values have been incorrectly modified during the upgrade. But after removing them and starting IE8 debugger they haven't appeared again. So probably they are not needed anymore.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-121603264159396581?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/TlybIlsAZDU" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-23T14:30:06.764-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/09/problem-with-internet-explorer-8.html</feedburner:origLink></item><item><title>How to map .ISO file to a drive in Windows 7</title><link>http://feedproxy.google.com/~r/Webnet/~3/TxagGYAiUjU/how-to-map-iso-file-to-drive-in-windows.html</link><category>Windows 7</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Thu, 17 Sep 2009 07:38:20 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-801207542971014249</guid><description>So, recently I have upgraded my laptop from Windows Vista to Windows 7. The upgrade process was straight forward and flawless and everything so far was OK except one thing: the &lt;a href="http://www.disc-tools.com/download/daemon"&gt;Daemon Tools&lt;/a&gt; that I've been using for mapping .ISO image files since 2004 on various Windows systems refuses to work on Windows 7. Even Windows 7 compatibility mode does not help: Daemon Tools manages to recognize Windows 7 anyways. Luckily there is another tool that provides with absolutely the same functionality and also free: &lt;a href="http://www.magiciso.com/tutorials/miso-magicdisc-history.htm"&gt;Magic Disc&lt;/a&gt;. It works under Windows 7 flawlessly and really makes my life easier: no need to burn ISO files on CD/DVD anymore.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-801207542971014249?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/TxagGYAiUjU" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-09-17T10:38:20.636-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.turlov.com/2009/09/how-to-map-iso-file-to-drive-in-windows.html</feedburner:origLink></item><item><title>ASP.NET user name availability check using WCSF Validation Bundle</title><link>http://feedproxy.google.com/~r/Webnet/~3/Wcfkvb9TC6k/aspnet-user-name-availability-check.html</link><category>AJAX</category><category>ASP.NET</category><category>WCSF</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 24 Jun 2009 10:21:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-4965728259954930567</guid><description>An average web site offering membership and protected content for its members requires users to sign up by visiting a sign-up or register page that allows a user to enter some information and create an account. A couple of pieces if information that users are commonly asked to enter are a User name or Login name and user's email. One potential problem with such user input is checking that entered login name and/or email address are available for registration and haven't been used by other users. When it's the case multiple attempts of entering available values can be very annoying and frustrating for users even making them to refuse registration on a web site. So improving user experience when validating login name and email is quite an important task.&lt;br /&gt;&lt;br /&gt;There is a number of ways of how to implement a user input validation and display an error message, for instance &lt;a href="http://encosia.com/2007/07/02/aspnet-username-availability-checking-via-ajax/"&gt;that one suggested by Dave Ward&lt;/a&gt;. In this post I am going to show you another relatively simple and elegant solution that provides with both  reliability and reasonably pleasant user experience.&lt;br /&gt;&lt;br /&gt;The solution is based on using a &lt;a href="http://msdn.microsoft.com/en-us/library/cc304908.aspx"&gt;ServerSideValidationExtender control&lt;/a&gt; from &lt;a href="http://websf.codeplex.com/Wiki/View.aspx?title=Validation_landing_page&amp;amp;referringTitle=Home"&gt;Web Client Software Factory validation bundle&lt;/a&gt;. The &lt;i&gt;ServerSideValidationExtender&lt;/i&gt; control allows asynchronious invocation of a server-side validation handler that performs a validation right after a user finished entering data without a postback thus signifcantly improving the user experience at the same time leveraging robustness and security of server-side validation.&lt;br /&gt;&lt;h3&gt;Code example&lt;/h3&gt;For this example I will be using a really simple markup code:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblEmail" runat="server" Text="Email: "&gt;&lt;/asp:Label&gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="txtEmail" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&amp;lt;asp:CustomValidator ID="cvEmail" runat="server"&lt;br /&gt;    ErrorMessage="Email is already used"&lt;br /&gt;    ControlToValidate="txtEmail"&lt;br /&gt;    onservervalidate="cvEmail_ServerValidate" /&gt;&lt;br /&gt;&amp;lt;wcsf:ServerSideValidationExtender ID="ssveEmail" &lt;br /&gt;    TargetControlID="cvEmail" &lt;br /&gt;    ValidateEmptyText="false" runat="server" /&gt;&lt;br /&gt;&amp;lt;br /&gt;    &lt;br /&gt;&amp;lt;asp:Label ID="lblLogin" runat="server" Text="Login: "&gt;&lt;/asp:Label&gt;&lt;br /&gt;&amp;lt;asp:TextBox ID="txtLogin" runat="server"&gt;&lt;/asp:TextBox&gt;&lt;br /&gt;&amp;lt;asp:CustomValidator ID="cvLogin" runat="server"&lt;br /&gt;    ErrorMessage="Login name is already used" &lt;br /&gt;    ControlToValidate="txtLogin"&lt;br /&gt;    onservervalidate="cvEmail_ServerValidate" /&gt;&lt;br /&gt;&amp;lt;wcsf:ServerSideValidationExtender ID="ssveLogin" &lt;br /&gt;    TargetControlID="cvLogin" &lt;br /&gt;    ValidateEmptyText="false" runat="server" /&gt;&lt;br /&gt;&amp;lt;br /&gt;&lt;br /&gt;&amp;lt;asp:Button ID="cmdRegister" runat="server" Text="Register" /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;that effectively results in that UI in a browser:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wYfdNSEIRks/SkJdLe50ZWI/AAAAAAAAADE/DSKkDTzPYb4/s1600-h/ssvePic1.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 309px; height: 222px;" src="http://2.bp.blogspot.com/_wYfdNSEIRks/SkJdLe50ZWI/AAAAAAAAADE/DSKkDTzPYb4/s400/ssvePic1.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5350941759125087586" /&gt;&lt;/a&gt;&lt;br /&gt;For each &lt;i&gt;TextBox&lt;/i&gt; control requiring asynchronious server-side validation I've added a &lt;i&gt;CustomValidator&lt;/i&gt; control and a &lt;i&gt;ServerSideValidationExtender&lt;/i&gt; that has its &lt;i&gt;TargetID&lt;/i&gt; property set to an ID of a corresponding &lt;i&gt;CustomValidator&lt;/i&gt; control.&lt;br /&gt;&lt;br /&gt;Next I've added some code to the validation handlers for the &lt;i&gt;CustomValidator&lt;/i&gt; controls to the page's code behind and that's it:&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;protected void cvEmail_ServerValidate(object source, &lt;br /&gt;    ServerValidateEventArgs args)&lt;br /&gt;{&lt;br /&gt;  args.IsValid = string.IsNullOrEmpty(&lt;br /&gt;          Membership.GetUserNameByEmail(args.Value));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void cvLogin_ServerValidate(object source, &lt;br /&gt;    ServerValidateEventArgs args)&lt;br /&gt;{&lt;br /&gt;  args.IsValid = Membership.GetUser(args.Value) == null;&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Note that the &lt;i&gt;IsValid&lt;/i&gt; equals true when a user can not be found. The server-side validation handler is being executed asynchroniously every time a corresponding &lt;i&gt;TextBox&lt;/i&gt; loses its focus and if validation has failed (meaning that a user was found and login name or email is not available) a corresponding error message is displayed immediately on the page without a postback so a user does not have to click a submit button and wait for the page to render again to see the result of the validation.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wYfdNSEIRks/SkJdLStMgvI/AAAAAAAAADM/BJX2zjZ2APE/s1600-h/ssvePic2.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 200px;" src="http://2.bp.blogspot.com/_wYfdNSEIRks/SkJdLStMgvI/AAAAAAAAADM/BJX2zjZ2APE/s400/ssvePic2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5350941755850916594" /&gt;&lt;/a&gt;&lt;br /&gt;The only trick here is that in the server-side validation handler we can only access a value of the control being validated because values of other controls on the page haven't been updated on the server side (no postback, remember?!).&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Note&lt;/i&gt;. In the production code you may want to add some layout and styling to your HTML markup, and of course there will be perhaps other input boxes on a form with may be more validator controls but the approach won't change: no additional code required, the same well-known validation pattern but with nicer user experience. I would also recommend to implement a simple but very useful change to the &lt;i&gt;ServerSideValidationExtender&lt;/i&gt; control suggested by &lt;a href="http://elegantcode.com/2008/01/29/wcsf-client-side-validation-tweaks" target="_blanc"&gt;Jarod Ferguson&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-4965728259954930567?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Wcfkvb9TC6k" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-24T13:21:07.315-04:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_wYfdNSEIRks/SkJdLe50ZWI/AAAAAAAAADE/DSKkDTzPYb4/s72-c/ssvePic1.gif" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">4</thr:total><feedburner:origLink>http://blog.turlov.com/2009/06/aspnet-user-name-availability-check.html</feedburner:origLink></item><item><title>How to set programmatically a value of a watermarked TextBox via JavaScript</title><link>http://feedproxy.google.com/~r/Webnet/~3/Z6K90kw--Hk/how-to-programmatically-set-value-of.html</link><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Mon, 22 Jun 2009 07:38:47 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-8471929399420311533</guid><description>If you use &lt;a href="http://www.asp.net/ajax/" target="_blanc"&gt;ASP.NET AJAX&lt;/a&gt; and &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Default.aspx" target="_blanc"&gt;AJAX Control Toolkit&lt;/a&gt; you may find it useful to decorate some of your TextBox controls on a page with a &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/TextBoxWatermark/TextBoxWatermark.aspx" target="_blanc"&gt;TextBoxWatermark AJAX extender control&lt;/a&gt; from the AJAX Control Toolkit. It's fairly easy to use and a nice tool for improving both the page look and user experience.&lt;br /&gt;&lt;br /&gt;However if you need to set a value of a TextBox decorated with the TextBoxWatermark extender programmatically via JavaScript on the client-side you may notice that the behavior of the watermarked TextBox is different. If you use the regular way to set a value like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;$get(textBoxId).value = someText;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;then the value displayed in the TextBox on the page will change to the set value but the watermarked look will still be present and other AJAX Control Toolkit TextBox extenders (like a &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx" target="_blanc"&gt;Calendar extender&lt;/a&gt;, for instance) will not recognize the new value.&lt;br /&gt;&lt;br /&gt;This happens because the TextBoxWatermark extender can not recognize and intercept your JavaScript operation since it's designed to serve user interactions. However there is a correct way of programmatic access to the TextBox's value. We modify the code above like that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var textBox = $get(textBoxId);&lt;br /&gt;if (textBox.AjaxControlToolkitTextBoxWrapper) {&lt;br /&gt;    textBox.AjaxControlToolkitTextBoxWrapper.set_Value(someText);&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;    textBox.value = someText;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The explanation is that most of the TextBox extenders from the AJAX Control Toolkit including a TextBoxWatermark extender use a special proxy class AjaxControlToolkitTextBoxWrapper to manipulate with the &lt;span style="font-style:italic;"&gt;input&lt;/span&gt; elements. The proxy adds a special property &lt;span style="font-style:italic;"&gt;AjaxControlToolkitTextBoxWrapper&lt;/span&gt; to the &lt;span style="font-style:italic;"&gt;input&lt;/span&gt; element that contains a reference to itself allowing to access the value of the &lt;span style="font-style:italic;"&gt;input&lt;/span&gt; element correctly. Similarly, if you need to get a value of a watermarked TextBox you do it like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;var textBox = $get(textBoxId), text;&lt;br /&gt;if (textBox.AjaxControlToolkitTextBoxWrapper) {&lt;br /&gt;    text = textBox.AjaxControlToolkitTextBoxWrapper.get_Value();&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;    text = textBox.value;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-8471929399420311533?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Z6K90kw--Hk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-22T10:38:47.816-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/06/how-to-programmatically-set-value-of.html</feedburner:origLink></item><item><title>New version of ASP.NET AJAX Control Toolkit released</title><link>http://feedproxy.google.com/~r/Webnet/~3/iCeboM2n3vc/new-version-of-aspnet-ajax-control.html</link><category>Color Picker Extender</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 03 Jun 2009 11:40:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5554215373683993915</guid><description>The &lt;a href="http://ajaxcontroltoolkit.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27326"&gt;new release of ASP.NET AJAX Control Toolkit&lt;/a&gt; is available for download. Bertrand Le Roy has written a &lt;a href="http://weblogs.asp.net/bleroy/archive/2009/05/13/new-release-of-the-ajax-control-toolkit.aspx"&gt;very informative post&lt;/a&gt; about it. What particularly concerns me in this new release is that a &lt;a href="http://cpe.codeplex.com/"&gt;Color Picker extender&lt;/a&gt; is now &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ColorPicker/ColorPicker.aspx"&gt;included in the Ajax Control Toolkit&lt;/a&gt;. Hooray!&lt;br /&gt;&lt;br /&gt;Along with the new Toolkit release there come a whole bunch of new &lt;a href="http://www.asp.net/learn/ajax"&gt;tutorials&lt;/a&gt; and videos among them there are one &lt;a href="http://www.asp.net/learn/Ajax-Control-Toolkit/tutorial-51-cs.aspx"&gt;particularly nice tutorial about the Color Picker extender&lt;/a&gt; and an &lt;a href="http://www.asp.net/learn/ajax-videos/video-7113.aspx"&gt;excellent video tutorial&lt;/a&gt; by Joe Stagner. Thank you folks for such a great job!&lt;br /&gt;&lt;br /&gt;What that means for the Color Picker Extender users is that they don't have to download it separately from &lt;a href="http://cpe.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=17713"&gt;Codeplex&lt;/a&gt; anymore because it is included in the Ajax Control Toolkit. For those who can not switch to the new version of ACT yet the original Color Picker Extender control will continue to be available on Codeplex. During the next few days I will prepare and upload a new release synced up with the Ajax Control Toolkit.&lt;br /&gt;&lt;br /&gt;It is also very interesting to read people's opinions about the new release of ACT that they write in response to blog posts and on Codeplex. In general the responses are positive however some folks complain about something, mostly about insignificant things or because they missed something. I would like to remind everybody that Ajax Control Toolkit is completely a community initiative (with of course the initial kick-off help from Microsoft) and people who work on it take time for it out of their families and other important things so let's be more tolerant and if you've come across something really bad please use &lt;a href="http://ajaxcontroltoolkit.codeplex.com/WorkItem/List.aspx"&gt;the Issue Tracker&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In particular I was interested in reading responses about the ColorPicker (but of course ;-)). Interestingly all the complaints were about how its look and feel, not about functionality. I admit that the UI it provides is rather simplistic but here is my question back: where have you all folks been since the control was published almost a year ago and I was asking for your feedbacks and suggestions? Since then it's been downloaded more then 2000 times (and I don't count downloads of ACT source code) and almost no one except just a few people suggested anything about improving it. I take it as everybody has been satisfied. However now with a bit more visibility I suggest if you folks really want some progress with what concerns you please speak up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5554215373683993915?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/iCeboM2n3vc" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-03T14:40:56.212-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/06/new-version-of-aspnet-ajax-control.html</feedburner:origLink></item><item><title>Survey: Ajax usage among .NET developers</title><link>http://feedproxy.google.com/~r/Webnet/~3/U4WLGgBCBsw/survey-ajax-usage-among-net-developers.html</link><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 27 May 2009 11:29:20 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-6402913414519919360</guid><description>If you haven’t already and you are a .NET developer, please take a couple minutes and answer this survey, whether you use Ajax or not. There are a number of Ajax surveys around, but this is the only one that focuses on .NET developers.&lt;br /&gt;&lt;br /&gt;The survey: &lt;br /&gt;&lt;a href="http://www.zoomerang.com/Survey/?p=WEB22973CYKW2H" target="_blanc"&gt;http://www.zoomerang.com/Survey/?p=WEB22973CYKW2H&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-6402913414519919360?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/U4WLGgBCBsw" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-27T14:29:20.358-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/05/survey-ajax-usage-among-net-developers.html</feedburner:origLink></item><item><title>Enabling a WCSF solution for sub-Web Application Project</title><link>http://feedproxy.google.com/~r/Webnet/~3/X-rszkiJblw/enabling-wcsf-solution-for-sub-web.html</link><category>Guidance Automation</category><category>ASP.NET</category><category>WCSF</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 01 May 2009 13:34:42 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5611643284274261801</guid><description>If in your &lt;a href="http://msdn.microsoft.com/en-us/library/bb264518.aspx"&gt;WCSF&lt;/a&gt; solution you use Web Application Project (as opposed to Web Site Project) for your web site you are able to &lt;a href="http://msdn.microsoft.com/en-us/library/cc304702.aspx"&gt;use a so called sub-Web Application Project&lt;/a&gt; in order to further modularize your web application.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wYfdNSEIRks/SftawHwtnJI/AAAAAAAAACs/KVPJcxPGL9Y/s1600-h/wcsf_subweb.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 288px;" src="http://3.bp.blogspot.com/_wYfdNSEIRks/SftawHwtnJI/AAAAAAAAACs/KVPJcxPGL9Y/s400/wcsf_subweb.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5330954366686698642" /&gt;&lt;/a&gt;&lt;br /&gt;If you created a WAP WCSF solution from scratch this option will be available to your all right. However if you converted your Web Site WCSF solution to WAP WCSF solution or &lt;a href="http://blog.turlov.com/2008/05/upgrading-your-wcsf-solution-from-june.html"&gt;upgraded from the previous version of WCSF&lt;/a&gt; this option may not appear when you are trying to add a new business module to your solution.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Visibility of the "Create as sub-Web Application Project" checkbox depends on one single property of a solution file and if you don't see the checkbox open the .sln file with any text editor and check out that it contains the follwoing content:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;GlobalSection(ExtensibilityGlobals) = postSolution&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;...&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;IsWCSFSolutionWAP = True&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;...&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;EndGlobalSection&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Usually this section is located in the bottom of a .sln file and the red line is the key to solving the problem. If you don't see the line in your solution file simply add it and reload the solution in Visual Studio. Problem solved.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5611643284274261801?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/X-rszkiJblw" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-01T16:34:42.991-04:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_wYfdNSEIRks/SftawHwtnJI/AAAAAAAAACs/KVPJcxPGL9Y/s72-c/wcsf_subweb.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/05/enabling-wcsf-solution-for-sub-web.html</feedburner:origLink></item><item><title>How to Improve ASP.NET UpdatePanel Performance</title><link>http://feedproxy.google.com/~r/Webnet/~3/Qv6ILAGE32c/how-to-improve-aspnet-updatepanel.html</link><category>AJAX</category><category>ASP.NET</category><category>best practice</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Tue, 23 Jun 2009 07:10:11 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-1891726834682575819</guid><description>Since ASP.NET AJAX UpdatePanel was first introduced it has earned a strange mix of reputation. From one hand it has become a tool of first choice for many ASP.NET developers who wanted an easy way of introducing an AJAX-like behavior for their ASP.NET web apps. From another hand it has earned a lot of criticism from seasoned web developers because of certain performance consequences associated with complex usage scenarios.&lt;br /&gt;&lt;br /&gt;Well everything may be good and may be evil based on how we use it. From my experience consious and judicious use of UpdatePanel is the key to saving its benefits and avoiding potential problems.&lt;br /&gt;&lt;br /&gt;Below I suggest a number of rules that help achieving better results when using UpdatePanel.&lt;ul&gt;&lt;li&gt;Avoid automatic refreshing of UpdatePanel; always stay in control of which UpdatePanel and when refreshes: set &lt;b&gt;UpdateMode&lt;/b&gt; property to &lt;b&gt;Conditional&lt;/b&gt; (the default value is Always).&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Minimize the content of the UpdatePanel: the &amp;lt;ContentTemplate&amp;gt; should only include controls that are neccessary to refresh. For instance if user input requires server-side validation include only an error message mark-up in the UpdatePanel and leave the rest of the form outside.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Try to keep the partial postback trigger controls outside of their respective UpdatePanels unless its neccessary to change their markup.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Try to stick to a simple rule: one trigger for one UpdatePanel. If you need to refresh multiple UpdatePanels during one request add a trigger control to only one of those UpdatePanels and refresh the others programmatically in an event handler on the server. The idea is to avoid uncontrollable refreshing of unnecessary UpdatePanels.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Since ViewState is updated with every partial postback request turn the ViewState off on a page that contains the UpdatePanel wherever possible or store the ViewState on the server to avoid transferring it forth and back with every async request.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Since Page runs through its lifecycle during every partial postback and executes methods like Page_Load or Page_PreRender make sure that logic that is unneccessary for refreshing UpdatePanel is not executed by wrapping it in &lt;i&gt;if(!ScriptManager.IsInAsyncPostBack)&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you use UpdatePanel event handlers like Init, Load, PreRender and Unload make sure that code inside these event handlers does not execute unless neccessary by checking &lt;i&gt;Page.IsPostBack&lt;/i&gt; and &lt;i&gt;ScriptManager.IsInAsyncPostBack&lt;/i&gt; properties.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you trigger an UpdatePanel programmatically from the client-side (via JavaScript) make sure that its event handler check for the event trigger value using &lt;i&gt;Request.Params["__EVENTTARGET"]&lt;/i&gt; ot avoid unnecessary execution path.&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you programmatically update Page's Header (Title, etc.) or other Page's content that is outside UpdatePanel make sure that this code &lt;b&gt;never&lt;/b&gt; gets executed during partial postbacks. First of all its not neccessary since page does not refresh but also it may be dangerous because the content may not be handled properly by a browser.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;There may probably be more tricks and tips regarding usage of UpdatePanel but those mentioned above have been proven by real exeprience. I would also recommend reading an &lt;a href="http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/"&gt;excellent post&lt;/a&gt; by &lt;b&gt;&lt;i&gt;Dave Ward&lt;/i&gt;&lt;/b&gt; that helps understanding how UpdatePanel works behind the scene and never hesitate using Fiddler to investigate what your web app's doing.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-1891726834682575819?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Qv6ILAGE32c" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-23T10:10:11.486-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/02/how-to-improve-aspnet-updatepanel.html</feedburner:origLink></item><item><title>Using ColorPickerExtender Client-side Events</title><link>http://feedproxy.google.com/~r/Webnet/~3/UrcD3TIoH0k/using-colorpickerextender-client-side.html</link><category>Color Picker Extender</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 22 Apr 2009 07:26:23 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-6859556165800156565</guid><description>&lt;div&gt;There have been question about how to utilize the client-side functionality of the ColorPickerExtender in order to improve customer experience. Here is an example of how to use a &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;colorSelectionChanged &lt;/span&gt;client event.&lt;/div&gt;&lt;h3&gt;Subscribing to the &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;colorSelectionChanged &lt;/span&gt;event&lt;/h3&gt;&lt;div&gt;You can subscribe to the event either via JavaScript code or ASP.NET mark-up:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;    var&lt;/span&gt; cpe = $find(&lt;span class="Apple-style-span" style="color: rgb(153, 0, 0);"&gt;"ColorPickerExtender1"&lt;/span&gt;);&lt;br /&gt;    cpe.add_colorSelectionChanged(changeColor);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div&gt;Here &lt;span class="Apple-style-span" style="font-style: italic;"&gt;$find&lt;/span&gt; is a standard method of the ASP.NET AJAX Framework that retunrs an instance of the AJAX component by &lt;span class="Apple-style-span" style="font-style: italic;"&gt;BehaviourID&lt;/span&gt;; &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ColorPickerExtender1 &lt;/span&gt;is a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;BehaviourID &lt;/span&gt;of the ColorPickerExtender component and &lt;span class="Apple-style-span" style="font-style: italic;"&gt;changeColor &lt;/span&gt;is your JavaScript function that will be called when the event occurs.&lt;/div&gt;&lt;code&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;ajaxToolkit:ColorPickerExtender&lt;/span&gt; &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;ID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;="defaultCPE"&lt;/span&gt;  &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;runat&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;="server"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;    TargetControlID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;="Color1"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;    BehaviorID&lt;/span&gt;=&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;"ColorPicker1"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;    OnClientColorSelectionChanged&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;="changeColor"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;div&gt;Make sure that the &lt;span class="Apple-style-span" style="font-style: italic; "&gt;changeColor  &lt;span class="Apple-style-span" style="font-style: normal; "&gt;JavaScript function exists on the page otherwise you'll see a JavaScript error "changeColor is undefined". You may define a &lt;span class="Apple-style-span" style="font-style: italic; "&gt;changeColor &lt;span class="Apple-style-span" style="font-style: normal; "&gt;function like this:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;code&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;function&lt;/span&gt; changeColor(sender) {&lt;br /&gt;    sender.get_element().style.color = &lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;"#"&lt;/span&gt; + sender.get_selectedColor();&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When your function is called after a user picked a color (i.e. clicked a mouse on the color palette) a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;sender &lt;/span&gt;argument will point to the instance of the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ColorPickerExtender &lt;/span&gt;component that you can use inside your function. For instance, call a method &lt;span class="Apple-style-span" style="font-style: italic;"&gt;get_element()&lt;/span&gt; to retrieve a reference to an &lt;span class="Apple-style-span" style="font-style: italic;"&gt;input &lt;/span&gt;DOM element which the extender is attached to or use a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;get_selectedColor()&lt;/span&gt; method to retrieve a hexadecimal color code that the user selected. When assigning the color value to a DOM element style don't forget to prepend it with a&lt;span class="Apple-style-span" style="color: rgb(153, 0, 0);"&gt; '#'&lt;/span&gt; character.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-6859556165800156565?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/UrcD3TIoH0k" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-22T10:26:23.581-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2009/03/using-colorpickerextender-client-side.html</feedburner:origLink></item><item><title>ASP.NET AJAX Compatibility Patch for Safari 3.x and Google Chrome</title><link>http://feedproxy.google.com/~r/Webnet/~3/FDgla2ss-Fk/aspnet-ajax-compatibility-patch-for.html</link><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 30 Jan 2009 06:32:33 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-9173821638965454218</guid><description>The problem I am going to talk about is not new but it somehow managed to concern not so many developers so far. However it is a growing concern and more people would need a solution at some point.&lt;div&gt;&lt;/div&gt;&lt;br /&gt;The heart of the problem is there are two browsers with a groing number of users - Safari 3.x and Google Chrome, that ASP.NET AJAX framework is not compatible with. One part of the problem is induced by a fact that both browsers report themselves as "Webkit" which is not supported by ASP.NET AJAX. This part of the problem affects both Safari and Chrome users. The second part of the problem mostly affects Safari users because ASP.NET AJAX framework does "support" Safari (version 2.x) but in such a manner that makes your web application look a total disaster in Safari version 3.x. The suggested fix will help both cases. At least my tests showed quite a success.&lt;div&gt;&lt;/div&gt;&lt;br /&gt;Ideally we would need an official patch from Microsoft but since they have their own plans and busy with the next .NET/ASP.NET 4.0 and VS 2010 I would assume that there will be no fix till those versions are out. So let's stick to this solution for now.&lt;div&gt;&lt;/div&gt;&lt;br /&gt;The solutions for the problem were suggested by a couple of people: &lt;a href="http://forums.asp.net/p/1252014/2898429.aspx"&gt;http://forums.asp.net/p/1252014/2898429.aspx&lt;/a&gt; and &lt;a href="http://blog.lavablast.com/post/2008/10/Gotcha-WebKit-(Safari-3-and-Google-Chrome)-Bug-with-ASPNET-AJAX.aspx"&gt;http://blog.lavablast.com/post/2008/10/Gotcha-WebKit-(Safari-3-and-Google-Chrome)-Bug-with-ASPNET-AJAX.aspx&lt;/a&gt;. Since both solutions are absolutely the same I want to give both of them a credit.&lt;div&gt;&lt;/div&gt;&lt;br /&gt;So to the point, ASP.NET AJAX framework has a class &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Sys.Browser&lt;/span&gt; that represents a current browser and supports cross-browser compatibility for everything else. The solution simply extends the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Sys.Browser&lt;/span&gt; class to support a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Webkit &lt;/span&gt;browser:&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:Consolas;font-size:12px;"&gt;&lt;pre class="alt" style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: rgb(246, 236, 194); width: 100%; margin-top: 0em; margin-right: 0em; margin-bottom: 0em; margin-left: 0em; "&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Sys.Browser.WebKit = {}; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;if&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;( navigator.userAgent.indexOf(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;'WebKit/'&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;) &gt; -1 )  {   &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;Sys.Browser.agent = Sys.Browser.WebKit;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;Sys.Browser.version = parseFloat(navigator.userAgent.match(/WebKit\/(\d+(\.\d+)?)/)[1]);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;    &lt;/span&gt;Sys.Browser.name = &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;'WebKit'&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;That is all the code you need. To apply this code to your web application you will need to create a javascript file, let's say &lt;span class="Apple-style-span" style="font-style: italic;"&gt;webkit.js&lt;/span&gt; and reference it in your application using standard &lt;span class="Apple-style-span" style="font-style: italic;"&gt;ScriptManager&lt;/span&gt; server control. You can reference the fix as a file using this syntax:&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="  ;font-family:Verdana;font-size:12px;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;span style="font-size:85%;color:#0000ff;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;&amp;lt;asp:ScriptManager &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;ID&lt;/span&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;sm&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;" &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;runat&lt;/span&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;server&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;"&amp;gt;&lt;br /&gt;    &amp;lt;Scripts&amp;gt;&lt;br /&gt;        &amp;lt;asp:ScriptReference &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Path&lt;/span&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;~/Scripts/webkit.js&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;" /&amp;gt;&lt;br /&gt;    Scripts&amp;gt;&lt;br /&gt;/asp:ScriptManager&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;or embed it into an assembly (my preferred way) and reference it from the assembly as an embedded resource:&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:13px;"&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;&amp;lt;asp:ScriptManager &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;ID&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;sm&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;" &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;runat&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;server&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;"&amp;gt;&lt;br /&gt;    &amp;lt;Scripts&amp;gt;&lt;br /&gt;        &amp;lt;asp:ScriptReference &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Assembly&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;Scripts&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;" &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;Name&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;="&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;Scripts.webkit.js&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(153, 51, 0);"&gt;" /&amp;gt;&lt;br /&gt;    Scripts&amp;gt;&lt;br /&gt;/asp:ScriptManager&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;Note that when you reference the fix from an assembly don't forget to add an assembly default namespace to the file name in the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Name &lt;/span&gt;attribute.&lt;div&gt;&lt;/div&gt;&lt;br /&gt;In conclusion, according to my tests the fix eliminated problems with &lt;span class="Apple-style-span" style="font-style: italic;"&gt;UpdatePanel&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-style: italic;"&gt;AjaxControlToolkit &lt;/span&gt;and &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Virtual Earth&lt;/span&gt; map control.&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-9173821638965454218?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/FDgla2ss-Fk" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-30T09:32:33.526-05:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://blog.turlov.com/2009/01/aspnet-ajax-compatibility-patch-for.html</feedburner:origLink></item><item><title>Search Engine Friendly Error Handling</title><link>http://feedproxy.google.com/~r/Webnet/~3/5NAlQg_2pjI/search-engine-friendly-error-handling.html</link><category>ASP.NET</category><category>SEO</category><category>best practice</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Mon, 04 May 2009 13:30:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-8527957612755063875</guid><description>ASP.NET provides a standard way to handle errors in web applications by configuring a &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;customError&lt;/span&gt;&lt;/span&gt; section in the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;Web.config&lt;/span&gt;&lt;/span&gt; file. Standard behaviour is to redirect a user from an erroneous page to an error page that in its turn shows some kind of more or less friendly explanation of what has happened.&lt;br /&gt;&lt;br /&gt;This approach is quite OK for intranet web applications but usually is not appropriate for a public web app accessible for search engines.&lt;br /&gt;&lt;br /&gt;The main problem here is that when error happens ASP.NET returns &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 102, 0);"&gt;302 "temporary redirect"&lt;/span&gt;&lt;/span&gt; response redirecting browser to the error page configured in the &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Web.config&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;If the erroneous page was accessed by a SE bot the bot would index a content of the error handling page under the original page's URL thus creating a wrong index entry.&lt;br /&gt;&lt;br /&gt;Another problem is if the actual error on the page was that the requested content was not found. This scenario is quite regular on modern dynamic web sites that construct content pages dynamically based on a Url. In http world such a situation should be called as &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;404 "Not found"&lt;/span&gt;&lt;/span&gt; especially in the case of a bot visiting such a page. But ASP.NET standard handling will once again respond 302 and let the bot include a non existent page in a search index.&lt;br /&gt;&lt;br /&gt;What I am driving at is the correct error handling should always return a corresponding http status code for a SE bot with the appropriate content for the user. So how can we do that without writing too much code?&lt;br /&gt;&lt;br /&gt;Actually quite easy. Starting version 3.5 SP1 ASP.NET has a new attribute &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;redirectMode&lt;/span&gt;&lt;/span&gt; in the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;customError&lt;/span&gt;&lt;/span&gt; configuration section:&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&amp;lt;customerrors &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;mode&lt;/span&gt;="RemoteOnly" &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;defaultredirect&lt;/span&gt;="/errors/GenericError.aspx" &lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;redirectmode&lt;/span&gt;="ResponseRewrite"&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The new &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;redirectMode&lt;/span&gt;&lt;/span&gt; attribute can be assigned one of two values: &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;ResponseRedirect &lt;/span&gt;&lt;/span&gt;(default) and &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;ResponseRewrite&lt;/span&gt;&lt;/span&gt;. ResponseRewrite prevents the erroneous page being redirected with the code 302 to an error page however the content of the error page will be shown on the original page. Internally ASP.NET is doing &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;Server.Execute&lt;/span&gt;&lt;/span&gt; of the error page instead of &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;Response.Redirect&lt;/span&gt;&lt;/span&gt; as usual.&lt;br /&gt;&lt;br /&gt;So this is already a one third of work. The next thing we need to do is to return a correct http status code. It can be achieved by adding a few lines of code to the error page let's say to a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;Page_Load&lt;/span&gt;&lt;/span&gt; event handler:&lt;br /&gt;&lt;br /&gt;            &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;int &lt;/span&gt;httpCode = 500;&lt;br /&gt;            &lt;span class="Apple-style-span" style="color: rgb(51, 153, 153);"&gt;Exception &lt;/span&gt;ex = Server.GetLastError();&lt;br /&gt;            if (ex &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;is &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 153, 153);"&gt;HttpException&lt;/span&gt;)&lt;br /&gt;            {&lt;br /&gt;                httpCode = ((&lt;span class="Apple-style-span" style="color: rgb(51, 153, 153);"&gt;HttpException&lt;/span&gt;) ex).GetHttpCode();&lt;br /&gt;            }&lt;br /&gt;            Response.StatusCode = httpCode;&lt;br /&gt;&lt;br /&gt;This code checks if the reason of the error was an &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;HttpException&lt;/span&gt;&lt;/span&gt; (a standard .NET exception class) then it assigns an http code from the exception otherwise it returns 500. Now it's two third of work done.&lt;br /&gt;&lt;br /&gt;What left is to handle exceptions in your code properly. The best practices here are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If your application can not return a requested content for any reason except your application's internal problems then throw an &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;HttpException&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt; &lt;/span&gt;&lt;/span&gt;with the code 404 and it will be friendly handled by your error page.&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255); "&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;throw &lt;/span&gt;new &lt;span class="Apple-style-span" style="color: rgb(51, 153, 153); "&gt;HttpException&lt;/span&gt;(404, "Not found");&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Map other your application's specific exceptions to standard  http codes and return them too.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If your application throws an exception internally then wrap the internal exception with &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;HttpException&lt;/span&gt;&lt;/span&gt; using an appropriate http code.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;try&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;...&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;catch &lt;/span&gt;(&lt;span class="Apple-style-span" style="color: rgb(51, 153, 153);"&gt;Exception &lt;/span&gt;ex)&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255); "&gt;throw &lt;/span&gt;new &lt;span class="Apple-style-span" style="color: rgb(51, 153, 153); "&gt;HttpException&lt;/span&gt;(code, message, ex);&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/li&gt;&lt;/ul&gt;That's basically it. In conclusion just a few more notes.&lt;br /&gt;&lt;br /&gt;If an erroneous page happened to start rendering content before the error occurred you may want to clear it on the error page before outputting an error message:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Response.Clear();&lt;br /&gt;&lt;br /&gt;If for some reason you can not use the new &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;redirectMode &lt;/span&gt;&lt;/span&gt;attribute in the &lt;span class="Apple-style-span" style="font-style: italic;"&gt;.&lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;config&lt;/span&gt; file (older framework, application specifics, etc.) then just add a few lines of code to the &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;global.asax&lt;/span&gt; that do the same:&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;pre class="libCScode" style="white-space: pre-wrap;" id="ctl00_rs1_mainContentContainer_ctl24CSharp" space="preserve"&gt;&lt;span style="color:blue;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;void &lt;/span&gt;Application_Error(object sender, EventArgs e)  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;// Do something with the error, i.e. log, notify, etc. &lt;/span&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Server.Transfer(errorpage);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It may be a good idea to clear an error status on the error page after you're done with error handling:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   ClearError();&lt;br /&gt;&lt;br /&gt;Now that is all.&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-8527957612755063875?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/5NAlQg_2pjI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-04T16:30:56.873-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">5</thr:total><feedburner:origLink>http://blog.turlov.com/2009/01/search-engine-friendly-error-handling.html</feedburner:origLink></item><item><title>FIX: HTML documents may not be displayed correctly in IIS 7.0 on Windows Vista</title><link>http://feedproxy.google.com/~r/Webnet/~3/ubOkAJdVUsw/fix-html-documents-may-not-be-displayed.html</link><category>ASP.NET</category><category>IIS 7</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Tue, 09 Dec 2008 12:55:24 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5584990657538398539</guid><description>Recently I have finally upgraded to Windows Vista from Windows &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;XP&lt;/span&gt;. Except regular trouble of upgrading your operation system that feels like moving to a new house (which is people say worse then an earthquake and flooding together) I was quite frustrated by a number of annoying problems with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;IIS&lt;/span&gt; 7 when first it's not installed by default (all right, security is tougher now, but can I at least have an option?), then not all of the components installed that required by ASP.NET and VS2008 (is it so difficult to suggest a correct package?), then again my web app does not work with the default App Domain (why did you guys call it "default" and the real default call "&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;classic&lt;/span&gt;"?), and finally everything works but the site does not look like it should be.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I spent some time probing different setting of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;IIS&lt;/span&gt; and finally gave up and looked it up on the Internet. What a relief! It's a Microsoft bug and not me being an idiot! Actually it was submitted on March 17, 2007 and still not in SP1.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So the problem was that the entire static content of the web app including images and styles was not returning to a browser by &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;IIS&lt;/span&gt; (content length 0 bytes) because &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;IIS&lt;/span&gt; 7 initial configuration was incorrect when it was first installed on Vista.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I am not describing a fix here, read it here: &lt;a href="http://support.microsoft.com/kb/930901/en-us"&gt;http://support.microsoft.com/kb/930901/en-us&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5584990657538398539?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/ubOkAJdVUsw" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T15:55:24.492-05:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/12/fix-html-documents-may-not-be-displayed.html</feedburner:origLink></item><item><title>Canada Election 2008</title><link>http://feedproxy.google.com/~r/Webnet/~3/bNFo1JqsiKs/canada-election-2008.html</link><category>Social</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Thu, 15 Jan 2009 11:13:52 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5830632392993910637</guid><description>&lt;p&gt;Once again - out of the main topic, but I can't be silent, can I?&lt;/p&gt;  &lt;p&gt;So I was straggling with myself over understanding what party should I vote for. The challenge was that it's not easy to figure out their election platforms. They do make a lot of noise but when it actually comes to statements there is somehow magically not so much to hear. Who are you talking to, guys? Can't you just drop your theatrical games and speak clearly of what you are about to do?&lt;/p&gt;  &lt;p&gt;Of course there are public images that could help making a choice: liberals are "thieves", conservatives are too easily "sold" to private interest groups, bloc are "nationalists", green are "blah" and NDP are "don't know who exactly". But still the statements are much easier to analyze for a thinking person.&lt;/p&gt;  &lt;p&gt;Luckily there is this very helpful &lt;a href="http://www3.thestar.com/static/election/quiz/index.html" target="_blank"&gt;web page called "Party Game"&lt;/a&gt; on thestar.com that shows the positions of all the parties on the main 8 problems. You take a quiz where you select your choice of a solution for each problem and at the end you see which party aligns the best with your own platform. Very helpful and surprising! Now I almost know who I will be voting for.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5830632392993910637?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/bNFo1JqsiKs" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-15T14:13:52.257-05:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/10/canada-election-2008.html</feedburner:origLink></item><item><title>More About Color Picker ASP.NET AJAX Extender</title><link>http://feedproxy.google.com/~r/Webnet/~3/pSYfSO1E2UY/more-about-color-picker-aspnet-ajax.html</link><category>Color Picker Extender</category><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 01 Oct 2008 11:17:15 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-2619983960968987877</guid><description>&lt;p&gt;I have published an article on &lt;a href="http://www.codeproject.com/KB/ajax/cpext.aspx"&gt;Code Project&lt;/a&gt; about the Color Picker ASP.NET AJAX Extender. Please read it &lt;a href="http://www.codeproject.com/KB/ajax/cpext.aspx"&gt;there&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-2619983960968987877?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/pSYfSO1E2UY" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-01T14:17:15.115-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/10/more-about-color-picker-aspnet-ajax.html</feedburner:origLink></item><item><title>Money as Debt!!!</title><link>http://feedproxy.google.com/~r/Webnet/~3/4OsemJml7bI/money-as-debt.html</link><category>Social</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 29 Apr 2009 10:56:18 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5415365841010107683</guid><description>&lt;p&gt;It's completely out of the topic of this blog but I must share this because it's totally overwhelming! Watch this:&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c1c282c7-8184-4a7e-ba96-c07a3f0330d6" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;embed id="VideoPlayback" src="http://video.google.com/googleplayer.swf?docid=6433985877267580603&amp;amp;hl=en&amp;amp;fs=true" style="width:400px;height:326px" allowfullscreen="true" allowscriptaccess="always" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;  &lt;/div&gt;&lt;/div&gt;&lt;br /&gt;or go to a &lt;a href="http://video.google.com/videoplay?docid=6433985877267580603&amp;amp;ei=MZP4Sb68CaOs_AGa7bThBw&amp;amp;hl=en"&gt;Google video page&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5415365841010107683?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/4OsemJml7bI" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-29T13:56:18.938-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/09/money-as-debt.html</feedburner:origLink></item><item><title>Color Picker ASP.NET AJAX extender control</title><link>http://feedproxy.google.com/~r/Webnet/~3/OaDMHOAt3wA/color-picker-aspnet-ajax-extender.html</link><category>Color Picker Extender</category><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Wed, 01 Oct 2008 11:17:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-4717118680242583115</guid><description>&lt;style type="text/css"&gt;.csharpcode,.csharpcode {font-size: small;color: black;font-family: consolas, "Courier New", courier, monospace;background-color: #ffffff;}.csharpcode pre { margin: 0em; }.csharpcode .rem { color: #008000; }.csharpcode .kwrd { color: #0000ff; }.csharpcode .str { color: #006080; }.csharpcode .op { color: #0000c0; }.csharpcode .preproc { color: #cc6633; }.csharpcode .asp { background-color: #ffff00; }.csharpcode .html { color: #800000; }.csharpcode .attr { color: #ff0000; }.csharpcode .alt {background-color: #f4f4f4;width: 100%;margin: 0em;}.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;br /&gt;&lt;p&gt;I was looking for a client-side color picker control and found it extremely difficult to find something that would satisfy to my requirements. I have found plenty of pure JavaScript controls written on very different levels of proficiency and there was even one &lt;a href="http://www.codeproject.com/KB/custom-controls/WS_ColorPicker.aspx"&gt;ASP.NET color-picker control&lt;/a&gt; that I almost liked but still my major requirement was not satisfied: I was looking for AJAX .NET Extender control - easy to use and based on a solid and proven platform.&lt;/p&gt;  &lt;p&gt;So I have researched what other color picker controls do and decided to write the one myself that I would base on Microsoft AJAX .NET platform. After some considerations I've decided to go even further and build an AJAX Control Toolkit Extender control.&lt;/p&gt;  &lt;p&gt;As an example I took an &lt;a href="http://www.asp.net/AJAX/AjaxControlToolkit/Samples/Calendar/Calendar.aspx"&gt;AJAX Control Toolkit Calendar extender&lt;/a&gt; and in my Color Picker extender control I also internally used another AJAX Control Toolkit control: Popup extender.&lt;/p&gt;  &lt;p&gt;So what are the advantages of implementing a client control as an ASP.NET AJAX extender?&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;You use ASP.NET page mark-up to render the control content to the browser.&lt;/li&gt;    &lt;li&gt;No need to manually inject JavaScript, HTML and other resources.&lt;/li&gt;    &lt;li&gt;You develop JavaScript code in a standalone file leveraging ASP.NET AJAX framework and Visual Studio intellisense abilities.&lt;/li&gt;    &lt;li&gt;JavaScript per se is very well structured, easy to read and debug. &lt;/li&gt;    &lt;li&gt;Many of the hassles of JavaScript client coding such as cross-browser compatibility, event handling, asynchronous calls are taken care of by ASP.NET AJAX framework.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;So I have spent a few days coding the control and finally it's out there. I have created a &lt;a href="http://www.codeplex.com/cpe"&gt;Codeplex project&lt;/a&gt; for it so if you are interested just go there and download the control and a Demo Web site.&lt;/p&gt;  &lt;p&gt;Now just a few more words about the extender. First, this is how it looks:&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wYfdNSEIRks/SN0yz5P6ANI/AAAAAAAAACQ/OB-jiPmEP_w/s1600-h/colorpicker.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_wYfdNSEIRks/SN0yz5P6ANI/AAAAAAAAACQ/OB-jiPmEP_w/s400/colorpicker.png" alt="" id="BLOGGER_PHOTO_ID_5250408607706120402" border="0" /&gt;&lt;/a&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Second, it's extremely easy to use. The extender attaches to an ASP.NET TextBox server control and to an optional button that can open a popup window and an element that samples a selected color in the background. User selects a color by clicking on a colored area. Below is a code example of using an extender on an ASP.NET page.&lt;/p&gt;  &lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="TextBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Columns&lt;/span&gt;&lt;span class="kwrd"&gt;="7"&lt;/span&gt; &lt;span class="attr"&gt;MaxLength&lt;/span&gt;&lt;span class="kwrd"&gt;="7"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ImageButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ImageButton1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;ImageUrl&lt;/span&gt;&lt;span class="kwrd"&gt;="~/Images/icon_colorpicker.gif"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;     &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;cdt:ColorPickerExtender&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="cpe"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;br /&gt;         &lt;span class="attr"&gt;TargetControlID&lt;/span&gt;&lt;span class="kwrd"&gt;="TextBox1"&lt;/span&gt;&lt;br /&gt;         &lt;span class="attr"&gt;SampleControlID&lt;/span&gt;&lt;span class="kwrd"&gt;="ImageButton1"&lt;/span&gt;&lt;br /&gt;         &lt;span class="attr"&gt;PopupButtonID&lt;/span&gt;&lt;span class="kwrd"&gt;="ImageButton1"&lt;/span&gt;&lt;br /&gt;      &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;Feel free to download the extender from the &lt;a href="http://www.codeplex.com/cpe"&gt;Codeplex&lt;/a&gt;, try it and post any comments or suggestions on the Codeplex project page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-4717118680242583115?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/OaDMHOAt3wA" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-01T14:17:56.768-04:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_wYfdNSEIRks/SN0yz5P6ANI/AAAAAAAAACQ/OB-jiPmEP_w/s72-c/colorpicker.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">8</thr:total><feedburner:origLink>http://blog.turlov.com/2008/09/color-picker-aspnet-ajax-extender.html</feedburner:origLink></item><item><title>Axialis IconWorkshop™ Lite for VS 2008</title><link>http://feedproxy.google.com/~r/Webnet/~3/ReaKQDn8dMM/axialis-iconworkshop-lite-for-vs-2008.html</link><category>Visual Studio</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 19 Sep 2008 11:48:16 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-4665318853850736371</guid><description>&lt;p&gt;It's been a &lt;a href="http://blogs.msdn.com/charlie/archive/2008/08/08/axialis-iconworkshop-lite-for-vs-2008.aspx"&gt;little buzz&lt;/a&gt; around this free VS2008 plug-in but it really is true and there is a &lt;a href="http://www.axialis.com/download/iwlite.html"&gt;free version of the Axialis IconWorkshop for VS2008&lt;/a&gt;. If you want to download and install it please use the &lt;a href="http://www.axialis.com/download/iwlite.html"&gt;direct link&lt;/a&gt; because you won't be able to find this page on the Axialis web site. Though to be honest its functionality is not anyhow better then Paint.Net which is also free but fully-functional. Besides being called a VS plug-in it opens up in a separate window. But see for yourself.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-4665318853850736371?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/ReaKQDn8dMM" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-19T14:48:16.217-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/09/axialis-iconworkshop-lite-for-vs-2008.html</feedburner:origLink></item><item><title>Working with VEColor class of VirtualEarth SDK</title><link>http://feedproxy.google.com/~r/Webnet/~3/f-eyWwti4Fs/working-with-vecolor-class-of.html</link><category>VirtualEarth</category><category>AJAX</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Mon, 15 Sep 2008 10:39:25 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-8311979265062712164</guid><description>If you ever wanted to set a color for a custom &lt;a href="http://msdn.microsoft.com/en-us/library/bb412535.aspx"&gt;VEShape&lt;/a&gt; object of type polyline or polygon than you must be familiar with the &lt;a href="http://msdn.microsoft.com/en-us/library/bb412453.aspx"&gt;VEColor&lt;/a&gt; class that is used to represent a color in &lt;a href="http://msdn.microsoft.com/en-us/library/aa905677.aspx"&gt;VirtualEarth SDK&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I am sure there are reasons behind of the design of the VEColor class, but for those who are used to a standard Web color representation in a form of 6-digit hexadecimal number it's kind of weird to provide 3 integer number in order to construct a color.&lt;br /&gt;&lt;br /&gt;So I was in a search for some convenient ways of converting between VEColor and standard Web color and first place I looked through was of course the VirtualEarth Map control because I thought that the VE developers themselves would need a way to perform the same exercise. No surprise there is a couple of non-documented VE objects to support such conversion technique.&lt;br /&gt;&lt;br /&gt;Here is a code example of using those objects:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;// Instanciate a convertor class&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; converter = &lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;new&lt;/span&gt; VEHexStringToColor();&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;// Converter returns an instance of a VEColor class&lt;br /&gt;// Transparency value is always set to 1.0&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; veColor = converter.Convert("aabbcc");&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;// Adjust transparency value&lt;/span&gt;&lt;br /&gt;veColor.A = 0.7;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0);"&gt;// Convert VEColor to a string with a leading '#'&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; webColor = VEColorToHexString(veColor);&lt;/code&gt;&lt;div&gt;&lt;code&gt;alert(webColor);&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Both objects are available on the page after you reference a VE Map control v6.1. Of course there is no guarantee of any support of those objects in any future versions of the VE Map control so use it at your own risk and have fun.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-8311979265062712164?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/f-eyWwti4Fs" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-15T13:39:25.797-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/09/working-with-vecolor-class-of.html</feedburner:origLink></item><item><title>Scalable CSS for Ajax Control Toolkit Tabs</title><link>http://feedproxy.google.com/~r/Webnet/~3/Lyjl_LDVYWE/scalable-css-for-ajax-control-toolkit.html</link><category>CSS</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Tue, 17 Jun 2008 08:51:07 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-184289632483112687</guid><description>If you use Tabs control from AJAX Control Toolkit library you may have noticed that the default CSS definition provided with the control does not display properly when you increase font size on a page, that is the default CSS is not scalable. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wYfdNSEIRks/SFfOE9QAgvI/AAAAAAAAABQ/0MJYBfecub8/s1600-h/Tabs1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_wYfdNSEIRks/SFfOE9QAgvI/AAAAAAAAABQ/0MJYBfecub8/s400/Tabs1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5212861678261142258" /&gt;&lt;/a&gt;&lt;br /&gt;Since Tabs allows you to override CSS it's quite easy to fix a problem. Just grab a &lt;a href="http://h9eaeq.bay.livefilestore.com/y1pOzNMFhiB7p5298XSiARVCce6mLRI_hfmCK0-eYJV0FvRjqLGR1YSQf9ypYMbktUUgi8GRnX7wgfWzxjTV1FU9w/AjaxToolkitTabsCss.zip?download"&gt;correct CSS file with the set of images&lt;/a&gt; and assign a CssClass property a new class name:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;        &amp;lt;ajaxToolkit:TabContainer runat="server" &lt;br /&gt;        CssClass = "myTabs" &lt;br /&gt;        ...&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now it looks more appropriate:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wYfdNSEIRks/SFfRFNwPTsI/AAAAAAAAABo/TEbFsxyOXCc/s1600-h/Tabs2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_wYfdNSEIRks/SFfRFNwPTsI/AAAAAAAAABo/TEbFsxyOXCc/s400/Tabs2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5212864981226180290" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-184289632483112687?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Lyjl_LDVYWE" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-06-17T11:51:07.797-04:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_wYfdNSEIRks/SFfOE9QAgvI/AAAAAAAAABQ/0MJYBfecub8/s72-c/Tabs1.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.turlov.com/2008/06/scalable-css-for-ajax-control-toolkit.html</feedburner:origLink></item><item><title>Access DataItem declaratively using data binding syntax</title><link>http://feedproxy.google.com/~r/Webnet/~3/Nhchhg1KFj0/access-dataitem-declaratively-using.html</link><category>ASP.NET</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Tue, 09 Dec 2008 13:14:34 PST</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-1896969070035111482</guid><description>Sometimes there is a need to access a DataItem object of a data-bound server control. It usually happens when you want to display the value of the bound object as a whole instead of its property.&lt;div&gt;&lt;br /&gt;&lt;div&gt;Standard data binding syntax assumes using a &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;Bind(string name)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; or &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;Eval(string name)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; methods in the context of &lt;code&gt;&lt;/code&gt; data binding expression where &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;name&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; is a name of a property of the &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;DataItem&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; object. But what if the data item if of type that does not have properties like &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;System.String&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; for examples? &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this case there is another method that you can use: &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;GetDataItem()&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;. It will return to you the current instance of the &lt;code&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;DataItem&lt;/span&gt;&lt;/span&gt;&lt;/code&gt; object.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;Syntax example:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;%# GetDataItem() %&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;That sort of syntax can be used even for &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-family: 'courier new';"&gt;DataSource&lt;/span&gt;&lt;/span&gt; properties in complex nested databound templated controls.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-1896969070035111482?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Nhchhg1KFj0" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-09T16:14:34.357-05:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://blog.turlov.com/2008/05/access-dataitem-declaratively-using.html</feedburner:origLink></item><item><title>Last-Modified HTTP header on ASP.NET page</title><link>http://feedproxy.google.com/~r/Webnet/~3/weUKuAOBAjo/last-modified-http-header-on-aspnet.html</link><category>ASP.NET</category><category>SEO</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 30 May 2008 12:46:56 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-5787958322343650937</guid><description>"Last-Modified" HTTP header is an important part of every web page since it helps browsers to cache pages' content locally and thus save HTML traffic. It is also used by internet search engines in order to determine the relevance of the pages' content and thus improves pages' indexing. By default a standard ASP.NET page does not include a "Last-Modified" header in the output HTML.&lt;br /&gt;&lt;br /&gt;One of the possible explanation for such behavior is that an ASPX page is considered dynamic by nature meaning that its content might be updated every time the page is requested. It is true in many cases for data-driven and interactive pages but most of the dynamic web sites also contain pages that are updated relatively rare or static.&lt;br /&gt;&lt;br /&gt;So when does it make sense to add a "Last-Modified" header to the page? First candidates usually are data-driven pages that display information from some sort of content storage systems (databases, files, etc.) and that information changes but not very frequently so there is a possibility that the same content may be viewed many times. Other apparent candidates are static pages even if they are data-driven but their content does not change for the lifetime.&lt;br /&gt;&lt;br /&gt;What are the pages that do not need the "Last-Modified" header? Obvious candidates are interactive pages and pages that displays user session related data.&lt;br /&gt;&lt;br /&gt;ASP.NET provides two methods to set the "Last-Modified" header on the page. Both of them belong to the &lt;code&gt;HttpCachePolicy&lt;/code&gt; class and are accessible through the &lt;code&gt;Cache&lt;/code&gt; property of the &lt;code&gt;Response&lt;/code&gt; object:&lt;pre&gt;Response.Cache.SetLastModified(DateTime date);&lt;br /&gt;Response.Cache.SetLastModifiedFromFileDependencies();&lt;/pre&gt;&lt;p&gt;The first method takes a &lt;code&gt;DateTime&lt;/code&gt; parameter that allows you to apply some algorithm for calculating the Last-Modified date of the page, for instance based on information from a database. The second method will calculate the date stamp automatically based for instance on the assembly build date. For the second method you can also include additional file dependencies in date calculation using&lt;/p&gt;&lt;pre&gt;Response.AddFileDependancy(string filename);&lt;/pre&gt;&lt;p&gt;For instance if a page displays a content of a static XML file you could include that XML file in the dependency and the "Last-Modified" header's value would be updated based on that file's "Date Modified" attribute.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-5787958322343650937?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/weUKuAOBAjo" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-30T15:46:56.772-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/05/last-modified-http-header-on-aspnet.html</feedburner:origLink></item><item><title>ScriptManager vs. ToolkitScriptManager</title><link>http://feedproxy.google.com/~r/Webnet/~3/536zBAiPpNs/scriptmanager-vs-toolkitscriptmanager.html</link><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 23 May 2008 11:45:57 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-3891423165444792811</guid><description>&lt;strong&gt;Introduction&lt;/strong&gt;&lt;br /&gt;ScriptManager is a special ASP.NET server control that should be placed on a page before you can use any of AJAX.NET enabled controls. The same rule is true for the AJAX Control Toolkit controls: they all require a ScriptManager on the page. While AJAX Control Toolkit controls work perfectly fine with the standard ASP.NET ScritpManager the Toolkit includes its own version of the ScriptManager called ToolkitScriptManager that inherits from ScriptManager and is meant to improve some of the ScriptManager's behaviors in particular how it renders out behavior JS scripts. Let's examine how using a ToolkitScriptManager changes a web page's appearance.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Experiment&lt;/strong&gt;&lt;br /&gt;As a testing example I have created a very simple page consisting of a single Accordion control from the AJAX Control Toolkit library.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;title&amp;gt;Untitled Page&amp;lt;/title&amp;gt;&lt;br /&gt;    &amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt;&lt;br /&gt;        .accHead { border:1px solid #445566;font-size:larger;background-color:#aaa;}&lt;br /&gt;        .accHeadSel { border:1px solid #445566;font-size:larger;background-color:#444;color:#fff;}&lt;br /&gt;        .accCont { border:1px solid #ccc;padding:5px;}&lt;br /&gt;    &amp;lt;/style&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;    &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;ajax:ToolkitScriptManager ID=&amp;quot;tsm&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/ajax:ToolkitScriptManager&amp;gt;&lt;br /&gt;    &amp;lt;%-- &amp;lt;asp:ScriptManager ID=&amp;quot;sm&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&amp;lt;/asp:ScriptManager&amp;gt;--%&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;ajax:Accordion&lt;br /&gt;    ID=&amp;quot;MyAccordion&amp;quot;&lt;br /&gt;    runat=&amp;quot;Server&amp;quot;&lt;br /&gt;    SelectedIndex=&amp;quot;0&amp;quot;&lt;br /&gt;    HeaderCssClass=&amp;quot;accHead&amp;quot;&lt;br /&gt;    HeaderSelectedCssClass=&amp;quot;accHeadSel&amp;quot;&lt;br /&gt;    ContentCssClass=&amp;quot;accCont&amp;quot;&lt;br /&gt;    AutoSize=&amp;quot;None&amp;quot;&lt;br /&gt;    FadeTransitions=&amp;quot;true&amp;quot;&lt;br /&gt;    TransitionDuration=&amp;quot;250&amp;quot;&lt;br /&gt;    FramesPerSecond=&amp;quot;40&amp;quot;&lt;br /&gt;    RequireOpenedPane=&amp;quot;false&amp;quot;&lt;br /&gt;    SuppressHeaderPostbacks=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;Panes&amp;gt;&lt;br /&gt;        &amp;lt;ajax:AccordionPane ID=&amp;quot;AccordionPane1&amp;quot; runat=&amp;quot;server&amp;quot;&lt;br /&gt;            HeaderCssClass=&amp;quot;accHead&amp;quot;&lt;br /&gt;            ContentCssClass=&amp;quot;accCont&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;Header&amp;gt;Pane Header 1&amp;lt;/Header&amp;gt;&lt;br /&gt;            &amp;lt;Content&amp;gt;Content 1&amp;lt;/Content&amp;gt;&lt;br /&gt;        &amp;lt;/ajax:AccordionPane&amp;gt;        &lt;br /&gt;        &amp;lt;ajax:AccordionPane ID=&amp;quot;AccordionPane2&amp;quot; runat=&amp;quot;server&amp;quot;&lt;br /&gt;            HeaderCssClass=&amp;quot;accHead&amp;quot;&lt;br /&gt;            ContentCssClass=&amp;quot;accCont&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;Header&amp;gt;Pane Header 2&amp;lt;/Header&amp;gt;&lt;br /&gt;            &amp;lt;Content&amp;gt;Content 2&amp;lt;/Content&amp;gt;&lt;br /&gt;        &amp;lt;/ajax:AccordionPane&amp;gt;        &lt;br /&gt;        &amp;lt;ajax:AccordionPane ID=&amp;quot;AccordionPane3&amp;quot; runat=&amp;quot;server&amp;quot;&lt;br /&gt;            HeaderCssClass=&amp;quot;accHead&amp;quot;&lt;br /&gt;            ContentCssClass=&amp;quot;accCont&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;Header&amp;gt;Pane Header 3&amp;lt;/Header&amp;gt;&lt;br /&gt;            &amp;lt;Content&amp;gt;Content 3&amp;lt;/Content&amp;gt;&lt;br /&gt;        &amp;lt;/ajax:AccordionPane&amp;gt;        &lt;br /&gt;    &amp;lt;/Panes&amp;gt;            &lt;br /&gt;    &amp;lt;HeaderTemplate&amp;gt;List of Panes&amp;lt;/HeaderTemplate&amp;gt;&lt;br /&gt;    &amp;lt;ContentTemplate&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&lt;br /&gt;&amp;lt;/ajax:Accordion&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;    &amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;You may have noticed that right after the &lt;code&gt;form&lt;/code&gt; tag there are ScriptManager (SM) control and ToolkitScriptManager (TSM) control on the page but one of them is commented out. Next I run a page from VS 2008 two times: first using the SM and second using TSM, and compare the results.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HTML output and traffic&lt;/strong&gt;&lt;br /&gt;Let's compare the HTML output of two page versions. See a WinMerge screen shot below that shows the SM version in the left pane and the TSM version in the right pane.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wYfdNSEIRks/SDb_i8PgPdI/AAAAAAAAABA/rcPz-qp6P-0/s1600-h/html_cmp.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_wYfdNSEIRks/SDb_i8PgPdI/AAAAAAAAABA/rcPz-qp6P-0/s400/html_cmp.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5203627395224976850" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First difference you see is that TSM adds its own hidden field on the page (top right pane) and the next and more important difference is that TSM renders one script reference on the page instead of the five ones that SM does.&lt;br /&gt;&lt;br /&gt;Now if we examine the page's traffic with the FireBug we'll see how that changes the traffic: first graph refers to the page using the SM control and the second one when the TSM's at work.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wYfdNSEIRks/SDb5tMPgPbI/AAAAAAAAAAw/NIxeRLUEwp8/s1600-h/fb_sm.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_wYfdNSEIRks/SDb5tMPgPbI/AAAAAAAAAAw/NIxeRLUEwp8/s400/fb_sm.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5203620974248869298" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wYfdNSEIRks/SDb5tcPgPcI/AAAAAAAAAA4/e0bVwVACmpk/s1600-h/fb_tsm.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_wYfdNSEIRks/SDb5tcPgPcI/AAAAAAAAAA4/e0bVwVACmpk/s400/fb_tsm.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5203620978543836610" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Analyzing the graphs it's easy to see that the TSM does reduce a number of browser's round-trips by combining multiple script references into a single one. This advantage will become more attractive as more AJAX-enabled server controls will be placed on a web page that support script combining. However it is not necessarily true that it will always reduce the page loading time. As you can see when TSM returns a combined script to the page it takes some time to perform a work on the server. Correspondingly the amount of work and consequentially the response time directly depend on the number of scripts to combine (that is a number of AJAX server controls) and the size of the scripts to process (white spaces removal and compressing).&lt;br /&gt;&lt;br /&gt;So there is no single recommendation that it's always preferable to use TSM instead of SM. In many cases SM version of a page may work faster then a TSM version of the page. Since it's not that difficult to alter a page for both cases I'd advise to test and compare both versions in your particular scenario before making a decision which one to choose.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-3891423165444792811?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/536zBAiPpNs" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-23T14:45:57.790-04:00</app:edited><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_wYfdNSEIRks/SDb_i8PgPdI/AAAAAAAAABA/rcPz-qp6P-0/s72-c/html_cmp.png" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">3</thr:total><feedburner:origLink>http://blog.turlov.com/2008/05/scriptmanager-vs-toolkitscriptmanager.html</feedburner:origLink></item><item><title>ToolkitScriptManager and Web Deployment Project</title><link>http://feedproxy.google.com/~r/Webnet/~3/bqOS4vF1wLg/toolkitscriptmanager-and-web-deployment.html</link><category>AJAX</category><category>ASP.NET</category><category>AJAX Control Toolkit</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Fri, 23 May 2008 11:49:16 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-1808273700896234852</guid><description>&lt;span style="font-weight: bold;"&gt;Problem description&lt;/span&gt;&lt;br /&gt;If you use AJAX Control Toolkit in your project you probably use &lt;code&gt;ToolkitScriptManager&lt;/code&gt; from the Toolkit instead of standard ASP.NET ScriptManager class. Now if you want to deploy your web application using Web Deployment Project (WDP) for VS2008 then you will find out very quickly that your AJAX enabled application features don't work. The reason for that is there is a JavaScript error on a page saying that the root JavaScript object for AJAX Control Toolkit is not defined on the page and all the subsequent scripts relying on that object have failed. I am not reproducing the exact message here because it may vary in different situations.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Background&lt;/span&gt;&lt;br /&gt;You have tested your web application many times in your Dev environments and everything worked just fine. So what you've changed is you used a Web Deployment Project to build and deploy your web application and you presumably wanted to take advantage of a famous precompile and merge feature of the WDP.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Explanation&lt;/span&gt;&lt;br /&gt;Now the problem is that the missing JavaScript on the page is rendered by a &lt;code&gt;ToolkitScriptManager&lt;/code&gt; object that generate a link to a JavaScript code using a ScriptResource handler which is in its turn supposed to retrieve the code embedded into assembly. Because WDP changes the names and locations of the assemblies &lt;code&gt;ToolitScriptManager&lt;/code&gt; was unable to resolve the assembly name and could not generate the link so your page does not have that JavaScript reference any more.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Workaround&lt;/span&gt;&lt;br /&gt;Use standard ASP.NET &lt;code&gt;ScriptManager&lt;/code&gt; instead of &lt;code&gt;ToolkitScriptManager&lt;/code&gt; and everything will work again.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What's next?&lt;/span&gt;&lt;br /&gt;I am in a process of investigating whether a &lt;code&gt;ToolkitScriptManager&lt;/code&gt; brings any advantages  comparing to a new &lt;code&gt;ScriptManager&lt;/code&gt; 3.5 in terms of more efficient HTML rendering and will post here my findings as soon as possible.&lt;br /&gt;&lt;br /&gt;Also if you are interested in employing a ToolkitScriptManager together with the Web Deployment Project I invite you to &lt;a href="http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=14642"&gt;vote for this bug on Codeplex&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-1808273700896234852?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/bqOS4vF1wLg" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-23T14:49:16.210-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/05/toolkitscriptmanager-and-web-deployment.html</feedburner:origLink></item><item><title>#if DEBUG in ASP.NET 2.0 code behind</title><link>http://feedproxy.google.com/~r/Webnet/~3/Mb58eXDmLok/if-debug-in-aspnet-20-code-behind.html</link><category>ASP.NET</category><category>#if</category><author>noreply@blogger.com (Alexander Turlov)</author><pubDate>Thu, 22 May 2008 09:38:37 PDT</pubDate><guid isPermaLink="false">tag:blogger.com,1999:blog-602850767119300869.post-1423024303481582758</guid><description>If you use an ASP.NET web site in your solution (another alternative is WAP - web application project) you may have noticed that there is no more compiler options in Configuration Manager that would have allowed you to add compiler constants like DEBUG. So the question pops up whether it's still possible to use very convenient way of excluding debug code from the production version by using #if preprocessor directive. Luckily it turns out that it's still supported and now it's related to a value of a "debug" attribute of a "compilation" element of the Web.config file. If you surround a part of your code with #if DEBUG ... #endif it will be included when debug="true" and excluded when debug="false".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/602850767119300869-1423024303481582758?l=blog.turlov.com'/&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Webnet/~4/Mb58eXDmLok" height="1" width="1"/&gt;</description><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-22T12:38:37.893-04:00</app:edited><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://blog.turlov.com/2008/05/if-debug-in-aspnet-20-code-behind.html</feedburner:origLink></item></channel></rss>
