<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SpinOneSolutions &#187; ASP.NET</title>
	<atom:link href="http://www.spinonesolutions.com/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.spinonesolutions.com</link>
	<description>I waste my time so that you don't have to...</description>
	<lastBuildDate>Mon, 16 May 2011 17:01:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>An AJAX Photo Gallery with Lightbox</title>
		<link>http://www.spinonesolutions.com/2008/12/ajax-photo-gallery-lightbox/</link>
		<comments>http://www.spinonesolutions.com/2008/12/ajax-photo-gallery-lightbox/#comments</comments>
		<pubDate>Fri, 19 Dec 2008 06:59:14 +0000</pubDate>
		<dc:creator>Will Wright</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.spinonesolutions.com/?p=5</guid>
		<description><![CDATA[The Problem Recently I updated WillWrightPhotography.com to use Microsoft&#8217;s AJAX framework.  That part worked out swimmingly.  The part that didn&#8217;t work out so well was that it broke my implementation of Slimbox. The Solution Enter Lightbox from Clientcide.  Navigate to the download page, scroll your way down to the &#8220;3rdParty&#8221; section.  Check &#8220;Lightbox&#8221;, hit download [...]]]></description>
			<content:encoded><![CDATA[<h3>The Problem</h3>
<p>Recently I updated <a title="WillWrightPhotography.com" href="http://www.willwrightphotography.com">WillWrightPhotography.com</a> to use Microsoft&#8217;s AJAX framework.  That part worked out swimmingly.  The part that didn&#8217;t work out so well was that it broke my implementation of <a href="http://www.digitalia.be/software/slimbox">Slimbox</a>.</p>
<h3>The Solution</h3>
<p>Enter <a href="http://www.clientcide.com/docs/3rdParty/Lightbox">Lightbox</a> from <a href="http://www.clientcide.com">Clientcide</a>.  Navigate to the download page, scroll your way down to the &#8220;3rdParty&#8221; section.  Check &#8220;Lightbox&#8221;, hit download and you&#8217;re almost done!</p>
<p><img class="alignnone size-full wp-image-11" title="Check Lightbox" src="http://www.spinonesolutions.com/wp-content/uploads/2008/12/image1.jpg" alt="Check Lightbox" width="499" height="153" /></p>
<p>Add a refernce to the JS file you just downloaded in your head tag (huh huh).</p>
<pre name="code" class="html">&lt;head runat="server"&gt;
    &lt;script type="text/javascript" language="javascript" src="js/mootools-1.2-core-yc.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="js/mootools-1.2-more.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="js/clientcide-trunk-705.compressed.js"&gt;&lt;/script&gt;
&lt;/head&gt;</pre>
<p>Now for the hard part!  Register a script block that runs after each asynchronous postback.  In my case I added it to the Page_Load method of the usercontrol that&#8217;s wrapped in the UpdatePanel.</p>
<pre name="code" class="c-sharp">protected void Page_Load(object sender, EventArgs e)
{
  string script = @"window.addEvent('domready', function() {
  new Lightbox();
  });";
  ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), System.Guid.NewGuid().ToString(), script, true);
}</pre>
<p>You&#8217;re all done!  Hit F5 and bask in the washed out glow from your monitor.</p>
<h3>The Particulars</h3>
<p>I&#8217;m using the <a href="http://mootools.net/">MooTools</a> JS framework, which is why I had choosen <a href="http://www.digitalia.be/software/slimbox">Slimbox</a> in the first place.  If you&#8217;re NOT already using MooTools; maybe you&#8217;re using jQuery or prototype, than this solution might not work for you.</p>
<p>The <a href="http://www.clientcide.com">Clientcide</a> libraries are an extension of the <a href="http://mootools.net/">MooTools</a> libraries, thus for some things they&#8217;re required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.spinonesolutions.com/2008/12/ajax-photo-gallery-lightbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

