<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetslackers.com/Community/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SimoneB's Blog : ASP.NET</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 SP1 (Build: 30415.43)</generator><item><title>CS2 - a personal source code search engine</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/09/13/CS2-_2D00_-a-personal-source-code-search-engine.aspx</link><pubDate>Thu, 13 Sep 2007 15:16:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1806</guid><dc:creator>simoneb</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=1806</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=1806</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/09/13/CS2-_2D00_-a-personal-source-code-search-engine.aspx#comments</comments><description>&lt;p&gt;As I &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2007/06/29/Indexing-and-searching-source-code-with-Lucene.Net.aspx"&gt;blogged some time ago&lt;/a&gt; I have been developing a source code search engine called &lt;a href="http://code.google.com/p/cs2project/"&gt;CS2&lt;/a&gt;. I completed it lately and, although it&amp;#39;s not as feature-rich as others - say, &lt;a href="http://www.koders.com/corp/products/pro/"&gt;Koders Pro Edition&lt;/a&gt; - it works pretty fine and suites the needs of whomever needs to search through code stored on its machine. Actually, it&amp;#39;s neither as heavy as Koders Pro as well, and plus it&amp;#39;s free and open source.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;It works as an ASP.NET 2.0 website and lets you request indexing folders and singular files, as well as search through them with a simple syntax. By default searches are performed in full-text fashion, but you can restrict queries on particular fields. The syntax is documented in the website. It&amp;#39;s multithreaded so indexing and searches can occur at the same time.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;It can be customized using the Properties.config file in the Configuration directory, by setting the folder where the files of the index are stored as well as the update interval. It&amp;#39;s capable of automatically removing from the index files which no longer exist on the file system as well as update those which have been edited.&lt;/p&gt;
&lt;p&gt;At the moment it can parse and index only C# source code but it&amp;#39;s written upon Windsor inversion of control container and can be easily extended just by adding a new parser. If anyone&amp;#39;s interested I will post about the complete process of adding a new parser.&lt;/p&gt;
&lt;p&gt;To get started just download the zipped website from the project homepage and run it. Then type the path of a folder containing C# source code files on your machine in the corresponding input field and wait some time for the indexing process to complete (you won&amp;#39;t see the progress since it occurs on another thread so that you can perform searches concurrently with indexing). Its duration depends upon the number of files to be parsed and indexed. Once indexing is complete updating the page shows the number of documents the index contains. Click on the link on the upper-right edge of the page to show the search syntax.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/09/13/CS2-_2D00_-a-personal-source-code-search-engine.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/09/13/CS2-_2D00_-a-personal-source-code-search-engine.aspx" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1806" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/IoC/default.aspx">IoC</category></item><item><title>New SQLite provider for ELMAH</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/09/06/New-SQLite-provider-for-ELMAH.aspx</link><pubDate>Wed, 05 Sep 2007 22:05:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1778</guid><dc:creator>simoneb</dc:creator><slash:comments>15</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=1778</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=1778</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/09/06/New-SQLite-provider-for-ELMAH.aspx#comments</comments><description>&lt;p&gt;I bet you know what ELMAH is, don&amp;#39;t you? ELMAH stands for Error Logging Modules and Handlers, and its main and only purpose is to log exceptions occurring in ASP.NET web applications, within which it integrates with just a couple of entries in the Web.config file. It&amp;#39;s got a lot of documentation and it&amp;#39;s open source, so for any additional information check out &lt;a href="http://code.google.com/p/elmah/"&gt;its website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Until yesterday it let you log exceptions in memory, on xml files and SQL Server, but a highly requested feature was to use &lt;a href="http://www.sqlite.org"&gt;SQLite&lt;/a&gt; as a backing store. Although I didn&amp;#39;t know SQLite much it has a cool &lt;a href="http://sourceforge.net/projects/sqlite-dotnet2/"&gt;.NET wrapper&lt;/a&gt; published on Sourceforge which exposes its features to the managed world, so I took on the &lt;a href="http://code.google.com/p/elmah/issues/detail?id=25"&gt;reported feature request&lt;/a&gt; and implemented it. SQLite doesn&amp;#39;t offer all of the features provided by SQL Server, but it&amp;#39;s almost completely SQL92 compliant so it has all that&amp;#39;s needed, and much more.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;So why to use SQLite instead of SQL Server or xml files? SQLite is a relational database engine, so it&amp;#39;s much faster than xml files, and compared with SQL Server at the moment our tests didn&amp;#39;t show any performance penalty; plus, it&amp;#39;s free! Paging through about 15.000 stored exceptions via ELMAH user interface resulted to be lightning fast!&lt;/p&gt;
&lt;p&gt;Since SQLite syntax isn&amp;#39;t widely documented, if anyone&amp;#39;s interested I will blog about it and the steps I went through to integrate it with ELMAH. Otherwise, the source code is available on &lt;a href="http://elmah.googlecode.com/svn/trunk/"&gt;ELMAH Subversion repository&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/09/06/New-SQLite-provider-for-ELMAH.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/09/06/New-SQLite-provider-for-ELMAH.aspx" /&gt;&lt;/a&gt;
&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1778" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category></item><item><title>ASP.NET Internals - the second article is available for reading</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/06/16/ASP.NET-Internals-_2D00_-the-second-article-is-available-for-reading.aspx</link><pubDate>Sat, 16 Jun 2007 01:38:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1491</guid><dc:creator>simoneb</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=1491</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=1491</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/06/16/ASP.NET-Internals-_2D00_-the-second-article-is-available-for-reading.aspx#comments</comments><description>&lt;p&gt;The &lt;a href="http://dotnetslackers.com/articles/iis/ASPNETInternalsIISAndTheProcessModel2.aspx"&gt;second article&lt;/a&gt; of my series about ASP.NET Internals is up. Before reading I reccomend giving a look at the &lt;a href="http://dotnetslackers.com/articles/iis/ASPNETInternalsIISAndTheProcessModel.aspx"&gt;first one&lt;/a&gt; however. &lt;/p&gt;&lt;p&gt;It took me a while to write it since I had to fiddle into the ASP.NET infrastructure with several profilers to get to understand the undocumented parts, but it was fun. In this article I&amp;#39;ve talked about the interaction between ISAPI extensions and managed code as well as the setup mechanism of AppDomains.&lt;/p&gt;&lt;p&gt;Next part will cover the principal managed part of ASP.NET, the HTTP Pipeline.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1491" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>ASP.NET Internals - follow my article series</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/05/02/ASP.NET-Internals-_2D00_-follow-my-article-series.aspx</link><pubDate>Wed, 02 May 2007 08:39:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1283</guid><dc:creator>simoneb</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=1283</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=1283</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/05/02/ASP.NET-Internals-_2D00_-follow-my-article-series.aspx#comments</comments><description>&lt;p&gt;A few days ago I &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2007/04/29/DotNetSlackers-is-growing-and-paying-you_2100_.aspx"&gt;wrote&lt;/a&gt; about the chance of writing technical articles for DotNetSlackers. My article has been published today and it&amp;#39;s the first of a series of 3 or 4 about the ASP.NET infrastructure. In this article I talked about IIS and the process model implemented by ASP.NET when running on different versions of IIS. In the next one I&amp;#39;ll tackle the ASP.NET pipeline and in the last one the compilation mode and page lifecycle, thus trying to cover all the aspects concerning the life cycle of a web request. I kept one eventual fourth article to talk about topics I didn&amp;#39;t cover in the former three, like the new features introduced by ISS 7 and threading.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;You can read the first article &lt;a href="http://dotnetslackers.com/articles/iis/ASPNETInternalsIISAndTheProcessModel.aspx"&gt;here&lt;/a&gt;. If you like the article please leave a vote, and well, feel free to leave a comment for any questions.&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1283" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>ASP.NET Singleton-per-Page pattern</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/04/17/ASP.NET-Singleton_2D00_per_2D00_Page-pattern.aspx</link><pubDate>Mon, 16 Apr 2007 23:18:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:1206</guid><dc:creator>simoneb</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=1206</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=1206</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/04/17/ASP.NET-Singleton_2D00_per_2D00_Page-pattern.aspx#comments</comments><description>&lt;p&gt;A while ago I &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/21/The-ASP.NET-Singleton_2D00_per_2D00_Request-pattern.aspx"&gt;blogged&lt;/a&gt; about a pattern useful to ensure that just a single instance of a class was created and used during a unique request-response pair. That seemed to make sense, since using the HttpContext.Items property prevents a single pipeline from instantiating that class more than once. &lt;/p&gt;

&lt;p&gt;At the time I didn&amp;#39;t realize that actually one could need a little more granularity and may incur in some issues when that instance needs logically to be bound to a &lt;strong&gt;single page instead of a single request-response&lt;/strong&gt;. One might be wondering where&amp;#39;s the difference, since &lt;em&gt;usually&lt;/em&gt; during a single request just a single page is executed. That&amp;#39;s true most of the times unless you use a subtle method of the HttpServerUtility class called Transfer.&lt;/p&gt;

&lt;p&gt;When that method is called, usually via the Server property of the Page class, the execution of the current page is interrupted and the control is passed to the new page specified as input parameter, which executes its whole life cycle from the beginning.&lt;/p&gt;

&lt;p&gt;In this case both the pages share the same HttpContext, and if in the singleton-per-request instance of the class you got a reference to the currently executing page (that&amp;#39;s what I needed to do in the &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/29/Registering-scripts-into-the-page-header-with-ASP.NET-2.0.aspx"&gt;HeadScriptManager&lt;/a&gt;), when you transfer the control to the new page your singleton instance still keeps a reference to the old page.&lt;/p&gt;

&lt;p&gt;This seems enough to introduce a sub pattern of the singleton-per-request which might be called singleton-per-page. The only problem is to find a place where to store information which is exclusive to a single page and not shared between pages, even if they are executed in the scope of the same context.&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The Page class features a property called Items, an instance of the HybridDictionary class, and that&amp;#39;s where we&amp;#39;ll store the singleton instance. Here&amp;#39;s a sample code to implement the Singleton-per-Page pattern:&lt;/p&gt;


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SingletonPerPage
{
    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; SingletonPerPage Current
    {
        get
        {
            Page currentPage = HttpContext.Current.Handler &lt;span class="kwrd"&gt;as&lt;/span&gt; Page;      

            &lt;span class="kwrd"&gt;if&lt;/span&gt;(currentPage == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
                &lt;span class="kwrd"&gt;throw&lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; NullReferenceException(&lt;span class="str"&gt;&amp;quot;The page is null&amp;quot;&lt;/span&gt;);

            &lt;span class="kwrd"&gt;return&lt;/span&gt; (currentPage.Items[&lt;span class="str"&gt;&amp;quot;SingletonPerPage&amp;quot;&lt;/span&gt;] ??
                   (currentPage.Items[&lt;span class="str"&gt;&amp;quot;SingletonPerPage&amp;quot;&lt;/span&gt;] = 
                    &lt;span class="kwrd"&gt;new&lt;/span&gt; SingletonPerPage())) &lt;span class="kwrd"&gt;as&lt;/span&gt; SingletonPerPage;
        }
    }&lt;br /&gt;}&lt;/pre&gt;

&lt;p&gt;From a mere performance point of view this seems a slightly better solution compared to the singleton-per-request, since the Items properties of the HttpContext and Page classes make use of different bags for storing data. As I said, the Page class uses HybridDictionary, a dictionary which internally makes use of the lightweight ListDictionary class until the number of items stored reaches 9, when it switches over to a HashTable; HttpContext instead makes directly use of a HashTable. What&amp;#39;s essential here is to be aware of the scope of the stuff you place there.&lt;br /&gt;
&lt;/p&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/04/17/ASP.NET-Singleton_2D00_per_2D00_Page-pattern.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/04/17/ASP.NET-Singleton_2D00_per_2D00_Page-pattern.aspx" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=1206" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Using an HttpModule to detect page refresh</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/01/07/Using-an-HttpModule-to-detect-page-refresh.aspx</link><pubDate>Sun, 07 Jan 2007 00:21:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:915</guid><dc:creator>simoneb</dc:creator><slash:comments>22</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=915</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=915</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/01/07/Using-an-HttpModule-to-detect-page-refresh.aspx#comments</comments><description>&lt;p&gt;While reading through the excellent &lt;a href="http://www.amazon.com/Programming-Microsoft-ASP-NET-2-0-Applications/dp/0735621772"&gt;ASP.NET book&lt;/a&gt; written by Dino Esposito I&amp;#39;ve come across a solution to detect page refreshes using an HttpModule. When I read it I couldn&amp;#39;t understand a line of the code and it seemed to me that it couldn&amp;#39;t work, so I started experimenting with it using the code available to download from MS Press website. I discovered that I had been a good runtime, since the code in fact doesn&amp;#39;t work very well. In particular, if you have more than one page opened concurrently you can see that the code behaves strangely, and the same can be said for the other couple of methods I&amp;#39;ve found out there (by &lt;a href="http://joel.net/code/refresh_capture.aspx"&gt;Joel Thoms&lt;/a&gt; and &lt;a href="http://jarednevans.typepad.com/technoblog/2005/01/jareds_techno_b.html"&gt;Jared Evans&lt;/a&gt;), which are mostly complex and unreliable.&lt;/p&gt;

&lt;p&gt;I started thinking about it from scratch and the question was: &amp;quot;How do I distinct between requests caused by the F5 or refresh button and normal requests?&amp;quot; That&amp;#39;s not an easy question, since the stateless nature of the HTTP protocol doesn&amp;#39;t allow to maintain state across requests, and maybe it has no answer, or, if you prefer, &amp;quot;You can&amp;#39;t&amp;quot;.&lt;/p&gt;

&lt;p&gt;So I restricted the problem; do I care about all requests or just the ones which POST something to the server? I think most people care just about POST requests, those which usually perform some kind of action on the server, like working with database data, and the same actions we don&amp;#39;t want to see duplicated because of a page refresh.&lt;br /&gt;
Therefore the question became: &amp;quot;How do I distinct between POST requests triggered by the interaction with the page and those fired by the F5 button?&amp;quot;. Luckily, in this case the DOM comes to help and a simple detail becomes the lifesaver. When you POST something to the server in the canonical way, the onsubmit event of the page form is fired; when you try reposting the same page to the server using F5 that event isn&amp;#39;t fired. &lt;br /&gt;
As far as I know this mechanism depends on the browser implementation, but I&amp;#39;ve tested it in IE7, FF 2.0.1 and Opera 9.10 and the all behave the same.&lt;/p&gt;

&lt;p&gt;This is the trick: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Each time a page&amp;#39;s form posts back we create on the client side a Guid (using Javascript) which is then assigned to a hidden field, so that when the request reaches the server we can retrieve that value. This means that if a page posts back via F5 it keeps the Guid which was generated during the last submission, since the onsumbit event is not fired again and thus no new Guid is generated.&lt;br /&gt;
&lt;/li&gt;

&lt;li&gt;On the server we keep a queue of all the Guids we have retrieved from the pages which posted back. Each time a page posts back we retrieve its Guid reading from the hidden field, and if it&amp;#39;s already in our queue it means that the page is a refresh.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That&amp;#39;s simple, isn&amp;#39;t it? Much simpler than all the methods which rely on Session state, Cookies. HttpContext.Items or whatever.&lt;/p&gt;

&lt;p&gt;&lt;span style="font-weight:bold;"&gt;Implementation details&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;The idea seems good! Let&amp;#39;s write it in code. We need to intercept requests, so we need an HttpModule. Each time a request arrives we add dynamically a HiddenField control to the page to keep our Guid value and then retrieve the Guid of the page (if one exists). If the Guid is in our queue then the page is refreshed, otherwise it&amp;#39;s a good clean postback. The only place where we can store this boolean value is the Items collection of the current HttpContext, so that it can be retrieved in the page code.&lt;br /&gt;
The queue where all the guids are kept resided in memory, so we need a way to define how many elements it can contain at most. It obviously depends on how many visitors the website has. The default value is 100; it means that if I do a postback, wait a bit before pressing F5 and during that time 100 genuine postbacks are fired by other users (or by myself but in another window/tab/browser) then my refresh is considered as a genuine postback because its Guid has already been dequeued (and I don&amp;#39;t want this to happen!).&lt;br /&gt;
&lt;/p&gt;

&lt;p style="font-weight:bold;"&gt;Setting up&lt;/p&gt;

&lt;p&gt;Place the assembly binary in the Bin directory of the website.&lt;br /&gt;
Since implemented as an HttpModule it has to be registered in the web.config file:&lt;/p&gt;


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;httpModules&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;add&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;RefreshModule&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;BusyBoxDotNet.RefreshModule&amp;quot;&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;httpModules&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;You can configure the size of the queue to fit your needs, otherwise the default value will be set to 100:&lt;/p&gt;


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;configSections&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;section&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;refresh&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;BusyBoxDotNet.RefreshSection, RefreshModule&amp;quot;&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;configSections&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;refresh&lt;/span&gt; &lt;span class="attr"&gt;queueSize&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;50&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p style="font-weight:bold;"&gt;Using&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The IsRefreshed key of the Context.Items collection is set during the page PreLoad phase, so it can be read starting from the Load phase in the page code, otherwise it will always return false.&lt;br /&gt;
To retrieve its value just check the Context.Items[&amp;quot;IsRefreshed&amp;quot;] boolean value, or use the base page class I&amp;#39;ve written for those who love strong typing, which exposes the wrapper boolean property IsRefreshed.&lt;/p&gt;
&lt;p&gt;NOTE: if you missed it before, remember that IsRefreshed (or Context.Items[&amp;quot;IsRefreshed&amp;quot;]) notifies you when a POST request is refreshed, not a GET request. That is, if you write a url in your browser&amp;#39;s address bar and then push F5, IsRefreshed will be false, because they are GET requests. Usually you care about detecting POST requests being refreshed, but in case you need GET requests refresh detection so this method doesn&amp;#39;t work for you.&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Attached to the post is a demo website which includes the binary.&lt;br /&gt;
The source code of this and all my other works is on the subversion repository of my main project: &lt;a href="http://sourceforge.net/projects/busybox"&gt;http://sourceforge.net/projects/busybox&lt;/a&gt;&amp;nbsp;&lt;/p&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/01/07/Using-an-HttpModule-to-detect-page-refresh.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2007/01/07/Using-an-HttpModule-to-detect-page-refresh.aspx" /&gt;&lt;/a&gt;
 &lt;br /&gt;

&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=915" width="1" height="1"&gt;</description><enclosure url="http://dotnetslackers.com/Community/blogs/simoneb/attachment/915.ashx" length="9153" type="application/zip" /><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item><item><title>Cascading autocomplete made easy</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/28/Cascading-autocomplete-made-easy.aspx</link><pubDate>Mon, 28 Aug 2006 00:20:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:460</guid><dc:creator>simoneb</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=460</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=460</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/28/Cascading-autocomplete-made-easy.aspx#comments</comments><description>Over the last few days the API of the &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;ScriptAculoUs.Net AutocompleteTextBox&lt;/a&gt; control has changed pretty much, since I&amp;#39;ve switched from a custom implementation based on reflection to the ASP.NET built-in callback mechanism.&lt;br /&gt;&lt;br /&gt;I chose to do the switch because the former implementation, despite being much more flexible, lacked in that it didn&amp;#39;t let you exploit the ASP.NET Page intrinsic objects like Session, ViewState, and web controls values inside the body of the method which supplied the suggestions, since that instance of the Page was instantiated via Reflection and didn&amp;#39;t run through the pipeline at all.&lt;br /&gt;&lt;br /&gt;Today I&amp;#39;m lazy about updating the original post - which has become a &amp;quot;patched post&amp;quot; - with the new details, and I chose instead to create a quick screencast to illustrate how easy and straightforward is to implement a cascading autocomplete pattern using the control.&lt;br /&gt;&lt;br /&gt;I haven&amp;#39;t released the binaries of the new version yet, because I want to do some more testing before, but the source can be found on the SVN repository by the &lt;a href="http://sourceforge.net/projects/busybox"&gt;project homepage&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Take a look at the &lt;a href="http://busyboxdotnet.qsh.eu/ScreenCasts/CascadingAutocomplete/CascadingAutocomplete.html"&gt;screencast&lt;/a&gt;, and please forgive a little mistake I did. When I populate the Cars collection I check for IsPostBack, but it made much more sense if I simply checked for nullness.&lt;br /&gt;&lt;br /&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/28/460.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/28/460.aspx" /&gt;&lt;/a&gt;
&lt;br /&gt;&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=460" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category></item><item><title>The ASP.NET Singleton-per-Request pattern</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/21/The-ASP.NET-Singleton_2D00_per_2D00_Request-pattern.aspx</link><pubDate>Mon, 21 Aug 2006 04:58:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:382</guid><dc:creator>simoneb</dc:creator><slash:comments>14</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=382</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=382</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/21/The-ASP.NET-Singleton_2D00_per_2D00_Request-pattern.aspx#comments</comments><description>Lately I needed to have an instance of a class to be unique for a certain amount of time, that is, one instance only of that class should exist for that time interval in my app domain.&lt;br&gt;In these cases what comes to my mind is the &lt;a href="http://www.yoda.arachsys.com/csharp/singleton.html"&gt;Singleton Design Pattern&lt;/a&gt;, which imposes that one instance only of a class can be loaded into an app domain and is alive as long as the app domain is.&lt;br&gt;My problem was that I needed that object to be unique only for a small time interval, which later I identified as being the life of a single request. That's when I recalled of a very useful IDictionary collection whose lifetime corresponds to the request-response cycle, and where you can store items which are then available during all the stages of the pipeline. This object is the &lt;i&gt;Items&lt;/i&gt; instance property of the &lt;i&gt;HttpContext &lt;/i&gt;class, and is defined as following:


&lt;pre class="csharpcode"&gt;System.Collections.IDictionary HttpContext.Items&lt;/pre&gt;

Let me say it again: into this collection you can store items that are then made available during all the request-response process, and are unique to that particular request-response. To enfore this and make it even clearer, the description of this object as given by the intellisense is:&lt;br&gt;&lt;br&gt;&lt;i&gt;Gets a key/value collection that can be used to organize and share data between&lt;br&gt;an System.Web.IHttpModule interface and an System.Web.IHttpHandler interface&lt;br&gt;during an HTTP request.&lt;/i&gt;&lt;br&gt;&lt;br&gt;You understand how powerful this object is, and the ASP.NET engine uses this mechanism itself to mantain some state information, like the session id and something more.&lt;br&gt;Going back to my problem, what I wanted to achieve is a lazy load (created only when necessary) instance of a class being unique to my request, so I came up with this code.


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SingletonPerRequest&lt;br&gt;{&lt;br&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; SingletonPerRequest Current&lt;br&gt;    {&lt;br&gt;        get&lt;br&gt;        {&lt;br&gt;            &lt;span class="kwrd"&gt;return&lt;/span&gt; (HttpContext.Current.Items[&lt;span class="str"&gt;"SingletonPerRequest"&lt;/span&gt;] ??&lt;br&gt;                (HttpContext.Current.Items[&lt;span class="str"&gt;"SingletonPerRequest"&lt;/span&gt;] = &lt;br&gt;                &lt;span class="kwrd"&gt;new&lt;/span&gt; SingletonPerRequest())) &lt;span class="kwrd"&gt;as&lt;/span&gt; SingletonPerRequest;&lt;br&gt;&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;

which can be used calling the static &lt;i&gt;Current&lt;/i&gt; property of the class. What this code does is check if an instance of the class is already in the Items collection. In that case, it returns a reference to that instance, otherwise a new instance is created and placed in the Items collection, so that the next time it is requested during this same request it's already there.&lt;br&gt;Note that here we don't need any synchronization mechanism, since a single request is not executed &lt;b&gt;concurrently &lt;/b&gt;by more than one thread.
&lt;br&gt;&lt;br&gt;
&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/21/382.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/21/382.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;
&lt;br&gt;&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=382" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/C_2300_/default.aspx">C#</category></item><item><title>ImageReflection with the Atlas Control Toolkit</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/16/348.aspx</link><pubDate>Wed, 16 Aug 2006 16:01:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:348</guid><dc:creator>simoneb</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=348</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=348</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/16/348.aspx#comments</comments><description>A few days ago I &lt;a href="/community/blogs/simoneb/archive/2006/07/30/255.aspx"&gt;blogged&lt;/a&gt; about an ASP.NET control I wrote to apply a neat effect to the images of a web form. In the meanwhile I found &lt;a href="http://cow.neondragon.net/stuff/reflection/"&gt;another implementation&lt;/a&gt; of the same effect which is much lighter in the means of both kBytes and cpu work and does exactly the same, so I decided to write another control using this one instead of the &lt;a href="http://mir.aculo.us/articles/2006/04/27/like-reflections-try-the-reflector"&gt;script.aculo.us&lt;/a&gt; version. &lt;br&gt;&lt;br&gt;Even I still don't like the Atlas Control Toolkit that much (suffice to say that it doesn't run in medium trust), I chose to try writing this new control using the MS framework. What I like about it is the way it extends the design mode representation of other controls, so that you don't need to create one extender for each of the controls you want to extend, but simply place one extender on the page and then hookup its properties via the wannabe-extended control's properties pane.&lt;br&gt;&lt;br&gt;Let me tell you that writing an extender with the Atlas Control Toolkit isn't that easy in the starting - and mostly if you are just trying to port and existing script behavior - because you first have to know what the Atlas framework is going to do with your script, and I'm not sure I understand everything is going on behind the scenes yet. &lt;br&gt;That said, realizing the right way of doing it wasn't much difficult in this case and after some refactorings of the original script I came up with an extender called &lt;i&gt;ImageReflectionExtender&lt;/i&gt;, which is built with the latest Atlas and Atlas Control Toolkit releases.&lt;br&gt;&lt;br&gt;&lt;a href="http://busyboxdotnet.qsh.eu/Downloads/qa.ashx?ImageReflection.bin.zip"&gt;Binaries&lt;/a&gt;, &lt;a href="http://busyboxdotnet.qsh.eu/Downloads/qa.ashx?ImageReflection.src.zip"&gt;source&lt;/a&gt; and a &lt;a href="http://busyboxdotnet.qsh.eu/ScreenCasts/ImageReflection/ImageReflection.html"&gt;screencast&lt;/a&gt; are available.&lt;br&gt;&lt;br&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/16/348.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/16/348.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;

&lt;br&gt;&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=348" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category></item><item><title>LiteBox meets Flickr: LiteBoxFlickrAlbum</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/10/LiteBox-meets-Flickr_3A00_-LiteBoxFlickrAlbum.aspx</link><pubDate>Wed, 09 Aug 2006 23:17:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:315</guid><dc:creator>simoneb</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=315</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=315</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/10/LiteBox-meets-Flickr_3A00_-LiteBoxFlickrAlbum.aspx#comments</comments><description>Yesterday I got a link on my news aggregator pointing to a &lt;a href="http://msdn.microsoft.com/coding4fun/webcoder/flickr/default.aspx"&gt;new article&lt;/a&gt; by &lt;a href="http://flickrdotnet.wdevs.com/"&gt;Sam Judson&lt;/a&gt; on &lt;a href="http://msdn.microsoft.com/coding4fun/"&gt;Coding4Fun&lt;/a&gt;, which talks about a .NET version of the API for the &lt;a href="http://www.flickr.com/services/"&gt;Flickr services&lt;/a&gt;.&lt;br /&gt;A nice idea immediately came to my mind, why not extending the &lt;em&gt;&lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/278.aspx"&gt;LiteBoxAlbum&lt;/a&gt;&lt;/em&gt; control to display photos retrieved via Flickr? This way I can have a LiteBox-like photo album which displays photos got from Flickr without writing a single line of code and by setting only a couple of properties, in order to tell the control which photos to look for.&lt;br /&gt;&lt;br /&gt;So I wrote a new control derived from &lt;em&gt;LiteBoxAlbum &lt;/em&gt;and called &lt;em&gt;LiteBoxFlickrAlbum&lt;/em&gt;. They differ in that while the former displays photos placed in the same folder as the page in which the control is added, the other looks for photos on Flickr. It exposes some new properties which are pretty self-descriptive. The only thing to notice is that Flickr lets you use the service only via a Flickr API Key, which it uses for tracking purposes. You&amp;#39;ll need to get one in order to use the control, and you can do it at &lt;a href="http://www.flickr.com/services/"&gt;this url&lt;/a&gt;. Once you have one, you can take a look at the screencast I recorded.&lt;br /&gt;&lt;br /&gt;Watch the &lt;a href="http://busyboxdotnet.qsh.eu/ScreenCasts/LiteBoxFlickrAlbum/LiteBoxFlickrAlbum.html"&gt;screencast&lt;/a&gt;!&lt;br /&gt;&lt;br /&gt;Source available on the &lt;a href="http://sourceforge.net/svn/?group_id=159977"&gt;SVN repository&lt;/a&gt; (quickstart &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/05/293.aspx"&gt;here&lt;/a&gt;) and binary available along with my &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;Script.Aculo.Us.Net library&lt;/a&gt; (bottom of the post).&lt;br /&gt;&lt;br /&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/10/315.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/10/315.aspx" /&gt;&lt;/a&gt;

&lt;br /&gt;&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=315" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category></item><item><title>ScriptAculoUs.Net on Sourceforge Project Hosting</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/05/ScriptAculoUs.Net-on-Google-Project-Hosting.aspx</link><pubDate>Sat, 05 Aug 2006 16:55:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:293</guid><dc:creator>simoneb</dc:creator><slash:comments>29</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=293</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=293</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/05/ScriptAculoUs.Net-on-Google-Project-Hosting.aspx#comments</comments><description>&lt;p&gt;All my projects are grouped under one main repository located on &lt;a href="http://sourceforge.net"&gt;Sourceforge&lt;/a&gt;, together with my main project, &lt;a href="http://sourceforge.net/projects/busybox"&gt;BusyBoxDotNet&lt;/a&gt;. The source code can be accessed via Subversion.&lt;br /&gt;&lt;br /&gt;&lt;strike&gt;&lt;/strike&gt; Here are the links:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Project homepage: &lt;a href="http://sourceforge.net/projects/busybox"&gt;http://sourceforge.net/projects/busybox&lt;/a&gt;&lt;a href="http://code.google.com/p/scriptaculousdotnet/"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;SVN Trunk: &lt;a href="http://busybox.svn.sourceforge.net/svnroot/busybox/trunk"&gt;http://busybox.svn.sourceforge.net/svnroot/busybox/trunk&lt;/a&gt;&lt;a href="http://scriptaculousdotnet.googlecode.com/svn/trunk/"&gt;&lt;br /&gt;&lt;/a&gt; (to be used for browsing the repository with a browser or with a SVN client)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SVN client: On Windows I suggest &lt;a href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;br /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;QuickStart Guide to SVN&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Getting (checking out) the source&lt;/u&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Install &lt;a href="http://tortoisesvn.net/downloads"&gt;TortoiseSVN&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Create a new folder - preferably in the same directory where you keep your Visual Studio projects - called ScriptAculoUs.Net - or whathever&lt;/li&gt;&lt;li&gt;Right click on the folder just created&lt;/li&gt;&lt;li&gt;Click on &amp;quot;SVN Checkout&amp;quot;&lt;/li&gt;&lt;li&gt;Type &amp;quot;http://busybox.svn.sourceforge.net/svnroot/busybox/trunk&amp;quot; in the textbox &amp;quot;URL of repository&amp;quot;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click OK. You should have all the source ready to be compiled&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;u&gt;Staying up to date with code changes&lt;/u&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Right click on the folder where you checked the sources out&lt;/li&gt;&lt;li&gt;Click on &amp;quot;SVN Update&amp;quot;&lt;/li&gt;&lt;/ol&gt;&lt;u&gt;How do I submit a change I think you may find useful?&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;In version control jargon, this is called &lt;em&gt;submitting a patch&lt;/em&gt;, that is, a small file containing only the changes made to the original code, so that it becomes easy and fast for the project members to review, evaluate and test them, and eventually include them in the code base.&lt;br /&gt;&lt;br /&gt;These are the steps to create a patch using TortoiseSVN:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Get the latest version of the source code - important in order not to make changes which may already have been done&lt;/li&gt;&lt;li&gt;Make your changes to the code&lt;/li&gt;&lt;li&gt;Right click on the folder where you checked out the source&lt;/li&gt;&lt;li&gt;On the TortoiseSVN context menu click on &amp;quot;Create Patch...&amp;quot;&lt;/li&gt;&lt;li&gt;Select the files where you have made changes and continue&lt;br /&gt;&lt;/li&gt;&lt;li&gt;You are asked to save the file containing the patch, so save it and give it a meaningful name&lt;/li&gt;&lt;li&gt;Contact me and I&amp;#39;ll be glad to review your patch!&lt;/li&gt;&lt;/ol&gt;&lt;a href="http://www.hanselman.com"&gt;Scott Hanselman&lt;/a&gt; furthermore wrote &lt;a href="http://www.hanselman.com/blog/ExampleHowToContributeAPatchToAnOpenSourceProjectLikeDasBlog.aspx"&gt;a more detailed post&lt;/a&gt; about creating a patches.&lt;br /&gt;&lt;br /&gt;If you&amp;#39;re interested in contributing the project or just give feedback or suggestions for future improvements you can even contact me via &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/contact.aspx"&gt;this link&lt;/a&gt;.&lt;br /&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=293" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/BusyBoxDotNet/default.aspx">BusyBoxDotNet</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/AJAX/default.aspx">AJAX</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Web+Design/default.aspx">Web Design</category></item><item><title>LiteBoxAlbum: Autogenerate LightBox-like photo albums</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/04/278.aspx</link><pubDate>Fri, 04 Aug 2006 13:28:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:278</guid><dc:creator>simoneb</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=278</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=278</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/04/278.aspx#comments</comments><description>UPDATE 10/08/06: A couple new features, read the bottom of the post for details.&lt;br&gt;&lt;br&gt;&lt;a href="/community/blogs/simoneb/archive/2006/08/04/276.aspx"&gt;Yesterday I posted&lt;/a&gt; about how I created a couple ASP.NET web controls to make it easy to generate a photo gallery using the &lt;a href="http://www.doknowevil.net/litebox/"&gt;LiteBox&lt;/a&gt; library. Ok now I have to make a confession, that was only a step to achieve something much more useful, an automated LighBox-like image slideshow!&lt;br&gt;&lt;br&gt;Some time ago I downloaded the very nice &lt;a href="http://www.gotdotnet.com/workspaces/workspace.aspx?id=1eceb66c-3bd0-4cdd-87d5-3fa0f4742032"&gt;PhotoHandler&lt;/a&gt; by &lt;a href="http://weblogs.asp.net/bleroy"&gt;Bertrand Le Roy&lt;/a&gt;, a control/handler which is very versatile and allows you to autogenerate image galleries on the fly, so I thought I would create something similar but instead using the functionality that LiteBox already gives us.&lt;br&gt;&lt;br&gt;The concept is simple. The control I created is called &lt;i&gt;LiteBoxAlbum&lt;/i&gt;, and when you drag it on a web form it automatically searches for images in the same folder of the page itself, and for each of them creates a &lt;i&gt;LiteBoxImageLink&lt;/i&gt; and renders it on the page in a hidden fashion, associating each link the same Group (so that you can navigate through them). When you run the page, it simulates a click of the mouse on the first link and starts the slideshow. Now you can navigate through all the images of the folder using the LiteBox interface. That's cool, isn't it? &lt;br&gt;I recorded a short screencast to show how to use it, even if it's very very simple. It required some black magic to start the slideshow automatically, since the Gecko DOM doesn't allow calling the click method on anchors, so I had to find a workaround which I'm reporting here in case you're interested in the trick:


&lt;pre class="csharpcode"&gt;function simulateClick(elementID) &lt;br&gt;{&lt;br&gt;    var el = $(elementID);&lt;br&gt;&lt;br&gt;    if(!document.all)&lt;br&gt;    {&lt;br&gt;        var evt = document.createEvent('MouseEvents');&lt;br&gt;        evt.initMouseEvent('click', true, true, window, 0, 0, &lt;br&gt;                           0, 0, 0, false, false, false, false, 0, null);&lt;br&gt;&lt;br&gt;        el.dispatchEvent(evt);&lt;br&gt;    }&lt;br&gt;    else&lt;br&gt;        el.click(); &lt;br&gt;}&lt;/pre&gt;

UPDATE 10/08/06: By the way, now you can also call the function which starts the album manually. A property called &lt;i&gt;ShowOnLoad&lt;/i&gt; lets you choose whether to show it automatically or not. To call the function manually the control exposes a property called &lt;i&gt;StartFunction &lt;/i&gt;which returns the Javascript statement to execute in order to start the album. This statement can be triggered, for instance, by an Html input button (the control which triggers it mustn't perform a postback or the album, of course, won't be shown).&lt;br&gt;Suppose you have placed an Html Input Button called &lt;i&gt;Button1&lt;/i&gt; on your webform, set its runat="server" attribute so that you can retrieve and assign its properties on the server-side.&lt;br&gt;On The Page_Load event handler you can write the following:


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br&gt;{&lt;br&gt;    Button1.Attributes[&lt;span class="str"&gt;"onclick"&lt;/span&gt;] = LiteBoxAlbum1.StartFunction;&lt;br&gt;}&lt;/pre&gt;Now whenever the button is clicked the album is started.&lt;br&gt;&lt;br&gt;The screencast can be watched &lt;a href="http://busyboxdotnet.qsh.eu/ScreenCasts/LiteBoxAlbum/LiteBoxAlbum.html"&gt;here&lt;/a&gt;, while sources and binaries can be downloaded along with my &lt;a href="/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;Script.Aculo.Us.Net&lt;/a&gt; bundle (bottom of the post).&lt;br&gt;&lt;br&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/278.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/278.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;

&lt;br&gt;&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=278" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Web+Design/default.aspx">Web Design</category></item><item><title>LightBox with ASP.NET</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/04/LightBox-with-ASP.NET.aspx</link><pubDate>Fri, 04 Aug 2006 04:06:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:276</guid><dc:creator>simoneb</dc:creator><slash:comments>61</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=276</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=276</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/08/04/LightBox-with-ASP.NET.aspx#comments</comments><description>If you don&amp;#39;t know what LightBoxes are check out the list at &lt;a href="http://www.blinklist.com/tag/lightbox/"&gt;blinklist&lt;/a&gt;. Among them two implementantions caught my attention, the original &lt;a href="http://www.huddletogether.com/projects/lightbox2/"&gt;LightBox JS 2.0&lt;/a&gt; by Lokesh Dhakar and the lighter &lt;a href="http://www.doknowevil.net/litebox/"&gt;LiteBox&lt;/a&gt; by Tyler Mulligan.&lt;br /&gt;&lt;br /&gt;The final result is exactly the same, they are able to show images in a really nice fashion, as well as create a slideshow out of them. They differ in some aspects by the way:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;LightBox JS is based on &lt;a href="http://script.aculo.us/"&gt;script.aculo.us&lt;/a&gt; and &lt;a href="http://prototype.conio.net/"&gt;prototype&lt;/a&gt; while LiteBox is based on &lt;a href="http://moofx.mad4milk.net/"&gt;moo.fx and prototype.lite&lt;/a&gt;, which are pratically a subset of the original libraries.&lt;/li&gt;&lt;li&gt;LightBox JS is heavy since its weight is about 100k, while LiteBox is much lighter, about 30k.&lt;/li&gt;&lt;/ul&gt;You might be wondering why the effect is exacly the same; well, script.aculo.us and prototype espose a great amount of functionality which LightBox JS doesn&amp;#39;t exploit, so there&amp;#39;s no need for such heavy libraries. That&amp;#39;s why I chose LiteBox for my own port to ASP.NET.&lt;br /&gt;&lt;br /&gt;Ok, so we want to get that effect with our images. In order to set LiteBox up you need to:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;include the scripts into your page&lt;/li&gt;&lt;li&gt;import a stylesheet&lt;/li&gt;&lt;li&gt;make LiteBox images available in some folder of your website in order for it to be able to retrieve them (I mean the images which show up in the LiteBox to perform navigation and close the box)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;place your anchors pointing to your images on the page&lt;br /&gt;&lt;/li&gt;&lt;li&gt;set the &lt;em&gt;rel&lt;/em&gt; attribute of your anchor elements to &amp;quot;lightbox&amp;quot;&lt;/li&gt;&lt;li&gt;[optional] or set the &lt;em&gt;rel&lt;/em&gt; attribute to &amp;quot;lightbox[&lt;em&gt;group&lt;/em&gt;]&amp;quot; in order to group together a set of images so that you can surf through them&lt;/li&gt;&lt;li&gt;[optional] set the &lt;em&gt;title&lt;/em&gt; attribute of the anchors to show a caption for the image.&lt;/li&gt;&lt;/ul&gt;Ok, too much to do in my opinion. Not very reusable. Let alone that if you want to show thumbnails of the images you have to wrap your anchors around &lt;em&gt;img&lt;/em&gt; tags! (ASP.NET HyperLink controls instead expose a property called ImageUrl which does just the same, and it&amp;#39;s what I&amp;#39;ve used for my implementation).&lt;br /&gt;&lt;br /&gt;So here comes my wrapper. &lt;em&gt;Nothing to read here the control LiteBoxExtender is obsolete, read on.&lt;/em&gt; &lt;font color="#d3d3d3"&gt;I created a webcontrol called &lt;em&gt;LiteBoxExtender&lt;/em&gt; which includes the scripts and the stylesheet for you, and which will come even more useful later. This control is a non visual control, and works together with another control called &lt;em&gt;LiteBoxImageLink &lt;/em&gt;which is wired up automatically to the &lt;em&gt;LiteBoxExtender&lt;/em&gt; once dragged on the webform and which represents a link to an image.&lt;/font&gt; &lt;br /&gt;The &lt;em&gt;LiteBoxImageLink&lt;/em&gt; is derived from &lt;em&gt;HyperLink&lt;/em&gt; and behaves the same it does. It only exposes one more property called Group.&lt;br /&gt;So in order to set it up all you have to do is:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Drag on the page as many &lt;em&gt;LiteBoxImageLinks&lt;/em&gt; as you want. Each one will represent an image which will show up in the LiteBox.&lt;/li&gt;&lt;li&gt;Set the properties of the &lt;em&gt;LiteBoxImageLink&lt;/em&gt; controls:&lt;/li&gt;&lt;/ol&gt;&lt;ol&gt;&lt;ul&gt;&lt;li&gt;NavigateUrl: the url of the image which will show up in the LiteBox&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;[optional] Text: the text to show in the link to the image&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;[optional] ImageUrl: the url of the preview image (to be used instead of Text)&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;[optional] Group: a group name, in order to group images together and be able to surf through them.&lt;/li&gt;&lt;/ul&gt;&lt;/ol&gt;&lt;p&gt;It&amp;#39;s that easy, no more scripts and styles to deal with, no images to copy in your website folders, and no manual editing of your anchors to wire up the LiteBox, the controls will do that by themselves. Of course it will work with normal HyperLink controls too as well as with anything that renders on the page as an html anchor tag, but in that case you&amp;#39;ll have to follow the manual procedure and set the &lt;em&gt;rel&lt;/em&gt; attributes yourself.&lt;br /&gt;&lt;br /&gt;The control is available inside my &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;Script.Aculo.Us.Net&lt;/a&gt; library. &lt;/p&gt;&lt;p&gt;UPDATE: sources are now only available via the SVN repository. Read &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/05/293.aspx"&gt;here&lt;/a&gt; for details. If you download the library you&amp;#39;ll find another control called &lt;em&gt;LiteBoxAlbum&lt;/em&gt;. I&amp;#39;m not talking about it here since it deserves another post, but it is much cooler than the controls I&amp;#39;ve described in this post, so you may want to check it out. One advice only, create a blank webform, drag a LiteBox album control in it and place some images (.jpg or .gif) in the same directory as the webform. Then just browse to the page and enjoy!&lt;br /&gt;UPDATE: The follow-up has been posted and is available &lt;a href="http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/278.aspx"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/276.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/08/04/276.aspx" /&gt;&lt;/a&gt;

&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=276" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Web+Design/default.aspx">Web Design</category></item><item><title>SweetTitles - fading tooltips (and my extender)</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/07/31/261.aspx</link><pubDate>Mon, 31 Jul 2006 01:12:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:261</guid><dc:creator>simoneb</dc:creator><slash:comments>20</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=261</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=261</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/07/31/261.aspx#comments</comments><description>&lt;a href="http://www.dustindiaz.com"&gt;Dustin Diaz&lt;/a&gt;, among other cool things, has written a nice Javascript library called &lt;a href="http://www.dustindiaz.com/sweet-titles"&gt;SweetTitles&lt;/a&gt; to convert hyperlink's Title attribute (Tooltip property in ASP.NET HyperLink web controls) - those yellow popups appearing when you hover the mouse over them - into nice fading boxes.&lt;br&gt;&lt;br&gt;The picture below shows the effect change when using it:&lt;br&gt;&lt;br&gt;

&lt;img src="http://busyboxdotnet.qsh.eu/images/sweettitles1.jpg"&gt;

&lt;br&gt;&lt;br&gt;You should know I'm becoming the wrapper man so I thought I would ease its integration with ASP.NET into a draggable web control - as well as enhance it a bit. The control I created is a simple extender control and all you have to do is drag it onto your webform to see everything happen magically. All the HyperLinks and &amp;lt;a&amp;gt; tags on your page receive that nice effect for free.


&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:hyperlink&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="HyperLink1"&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;navigateurl&lt;/span&gt;&lt;span class="kwrd"&gt;="~/SomePage.aspx"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&lt;span class="attr"&gt;tooltip&lt;/span&gt;&lt;span class="kwrd"&gt;="I link to SomePage.aspx"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;SomePage&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:hyperlink&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt; &lt;span class="attr"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;="I link somewhere else"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="/SomeWhereElse"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;SomeWhereElse&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;a&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;


The control is called &lt;font face="Courier New"&gt;SweetTitlesExtender&lt;/font&gt;, has no runtime appearance and exposes a single enum property called &lt;font face="Courier New"&gt;EmbeddedStyleSheet&lt;/font&gt; with 5 values:&lt;br&gt;&lt;ul&gt;&lt;li&gt;None - no stylesheet will be embedded, you'll have to write your own&lt;br&gt;&lt;/li&gt;&lt;li&gt;Classic - the one shipped by Dustin Diaz with the library&lt;/li&gt;&lt;li&gt;Dustin - the one Dustin Diaz uses on his own website&lt;br&gt;&lt;/li&gt;&lt;li&gt;Blueish&lt;/li&gt;&lt;li&gt;Greenish&lt;/li&gt;&lt;li&gt;Reddish&lt;/li&gt;&lt;/ul&gt;That property allows to choose among some some stylesheets I have embedded into the assembly to provide some ready to use style options, which look like in the following picture (I'll let you guess which one corresponds to each enum value):&lt;br&gt;&lt;br&gt;

&lt;img src="http://busyboxdotnet.qsh.eu/images/sweettitles2.jpg"&gt;

&lt;br&gt;&lt;br&gt;In case you want to provide your own style, set the property to None and create a stylesheet with the following structure:


&lt;pre class="csharpcode"&gt;body div#toolTip { position:absolute;z-index:1000; [...] }&lt;br&gt;body div#toolTip p { [...] }&lt;br&gt;body div#toolTip p em { [...] }&lt;br&gt;body div#toolTip p em span { [...] }&lt;/pre&gt;


Since the original library is licensed under a &lt;a href="http://creativecommons.org/licenses/by-sa/2.5/"&gt;Creative Commons Attribution Share Alike (by-sa)&lt;/a&gt; license, my control is under the same license.&lt;br&gt;&lt;br&gt;&lt;a href="http://busyboxdotnet.qsh.eu/downloads/qa.ashx?SweetTitles.bin.zip"&gt;Binary&lt;/a&gt; and &lt;a href="http://busyboxdotnet.qsh.eu/downloads/qa.ashx?SweetTitles.src.zip"&gt;source&lt;/a&gt; available.&lt;br&gt;&lt;br&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/31/261.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/31/261.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;

&lt;br&gt;&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=261" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Web+Design/default.aspx">Web Design</category></item><item><title>Reflection for images... not *that* Reflection!</title><link>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/07/30/255.aspx</link><pubDate>Sun, 30 Jul 2006 01:38:00 GMT</pubDate><guid isPermaLink="false">6afe0437-14b4-41d5-bc66-6d54a24dbd48:255</guid><dc:creator>simoneb</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/rsscomments.aspx?PostID=255</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetslackers.com/Community/blogs/simoneb/commentapi.aspx?PostID=255</wfw:comment><comments>http://dotnetslackers.com/Community/blogs/simoneb/archive/2006/07/30/255.aspx#comments</comments><description>First just relax, I'm not talking about *that* &lt;span&gt;Reflection&lt;/span&gt;, instead about reflecting images.&lt;br&gt;Yes I said that. Thomas Fuchs, the inventor of &lt;a href="http://script.aculo.us/"&gt;script.aculo.us&lt;/a&gt;, whom you may have guessed I like pretty much, has an exciting post on his blog where he shows how he reflects images as if&amp;nbsp; they were in front of a mirror. You should definitely check it out &lt;a href="http://mir.aculo.us/stuff/reflector/reflector.html"&gt;here&lt;/a&gt;.&lt;br&gt;&lt;br&gt;

&lt;img src="http://busyboxdotnet.qsh.eu/images/ninfeereflected.jpg"&gt;

&lt;br&gt;&lt;br&gt;He says it's not production code, in fact you will experience high load on the cpu and on the memory while the script is running (especially on IE), but the effect is incredibly nice.&lt;br&gt;&lt;br&gt;Of course I couldn't restrain myself from writing an extender control for ASP.NET which lets you apply that effect to classic &lt;font face="Courier New"&gt;Image&lt;/font&gt; controls. I've bundled it into my &lt;a href="/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;Script.Aculo.Us.Net&lt;/a&gt; library, so that you can get the nice features all together. Oh, did you check out the new features? Now it can run side-by-side with Atlas...&lt;br&gt;&lt;br&gt;By the way, I've called this control &lt;font face="Courier New"&gt;ImageReflectorExtender&lt;/font&gt;, and it exposes three properties, which make using it a cakewalk.&lt;br&gt;&lt;ul&gt;&lt;li&gt;&lt;font face="Courier New"&gt;Image&lt;/font&gt;: a reference to an ASP.NET Image control on the page&lt;/li&gt;&lt;li&gt;&lt;font face="Courier New"&gt;Amount&lt;/font&gt;: the size of the reflected area&lt;/li&gt;&lt;li&gt;&lt;font face="Courier New"&gt;Opacity&lt;/font&gt;: the opacity of the reflected area&lt;/li&gt;&lt;/ul&gt;My advice is not to increase too much the values of &lt;font face="Courier New"&gt;Opacity &lt;/font&gt;and &lt;font face="Courier New"&gt;Amount &lt;/font&gt;because they lead to cpu and memory load as well as not to place more than one reflected image on a page and not much big too, for the same reason.&lt;br&gt;&lt;br&gt;Download links can be found at the bottom of &lt;a href="/community/blogs/simoneb/archive/2006/07/03/142.aspx"&gt;this post&lt;/a&gt;, all the controls working with script.aculo.us are bundled in a single assembly.&lt;br&gt;&lt;br&gt;

&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/30/255.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/community/blogs/simoneb/archive/2006/07/30/255.aspx" alt="kick it on DotNetKicks.com" border="0"&gt;&lt;/a&gt;

&lt;br&gt;&lt;br&gt;&lt;img src="http://dotnetslackers.com/Community/aggbug.aspx?PostID=255" width="1" height="1"&gt;</description><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Tools/default.aspx">Tools</category><category domain="http://dotnetslackers.com/Community/blogs/simoneb/archive/tags/Web+Design/default.aspx">Web Design</category></item></channel></rss>