<?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>shepherdweb.com &#187; ASP.NET</title>
	<atom:link href="http://shepherdweb.com/category/web-code/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://shepherdweb.com</link>
	<description>Shane Shepherd: web design and development; music</description>
	<lastBuildDate>Wed, 11 Nov 2009 01:46:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>ASP.NET Membership Provider Web Service</title>
		<link>http://shepherdweb.com/2009/10/31/asp-net-membership-provider-web-service/</link>
		<comments>http://shepherdweb.com/2009/10/31/asp-net-membership-provider-web-service/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 15:48:57 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://shepherdweb.com/?p=176</guid>
		<description><![CDATA[A couple of years ago I was in need of a full featured membership provider provided over web services. I found Shaun Wilde&#8217;s project. Shaun&#8217;s project provided a membership and role provider over web services, but lacked a profile provider. I added the profile provider. I ended up changing directions with the project I was [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I was in need of a full featured membership provider provided over web services.  I found <a href="http://www.codeproject.com/KB/aspnet/WSSecurityProvider.aspx">Shaun Wilde&#8217;s project</a>.  Shaun&#8217;s project provided a membership and role provider over web services, but lacked a profile provider.  I added the profile provider.  </p>
<p>I ended up changing directions with the project I was working on and this code never got used in production.  Testing on it was minimal and I haven&#8217;t touched it two years.  However, I have received a large number of requests for the code&#8230;so here it is:</p>
<p><a href="http://shepherdweb.com/lab/2009/MembershipAgent/MembershipAgent.zip">ASP.NET 2.0 Web Service Membership, Role, and Profile Provider</a></p>
<p>Feel free to post enhancements or suggestions here.</p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/asp.net" rel="tag">asp.net</a>, <a href="http://technorati.com/tag/membership+provider" rel="tag"> membership provider</a>, <a href="http://technorati.com/tag/role+provider" rel="tag"> role provider</a>, <a href="http://technorati.com/tag/profile+provider" rel="tag"> profile provider</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2009/10/31/asp-net-membership-provider-web-service/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC Presentation Notes</title>
		<link>http://shepherdweb.com/2008/02/20/aspnet-mvc-presentation-notes/</link>
		<comments>http://shepherdweb.com/2008/02/20/aspnet-mvc-presentation-notes/#comments</comments>
		<pubDate>Thu, 21 Feb 2008 02:25:41 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[LDNUG]]></category>
		<category><![CDATA[technology & web]]></category>

		<guid isPermaLink="false">http://shepherdweb.com/2008/02/20/aspnet-mvc-presentation-notes/</guid>
		<description><![CDATA[This post contains notes, links and a .zip of the project I built in my presentation to the Lubbock .NET Users Group. Requirements for this project include the following: ASP.NET 3.5 Framework ASP.NET 3.5 Extensions CTP ASP.NET MVC Toolkit Visual Studio 2008 Sites with Tutorial, Tips, Help, etc.. Scott Guthrie Intro and Tutorials: Intro Part [...]]]></description>
			<content:encoded><![CDATA[<p>This post contains notes, links and a .zip of the project I built in my presentation to the Lubbock .NET Users Group.  Requirements for this project include the following:</p>
<ul>
<li>ASP.NET 3.5 Framework</li>
<li>ASP.NET 3.5 Extensions CTP</li>
<li>ASP.NET MVC Toolkit</li>
<li>Visual Studio 2008</li>
</ul>
<h2>Sites with Tutorial, Tips, Help, etc..</h2>
<ul>
<li>Scott Guthrie Intro and Tutorials:
<ul>
<li><a href="http://http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx">Intro</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx">Part 1</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/12/03/asp-net-mvc-framework-part-2-url-routing.aspx">Part 2: URL Routing</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/12/06/asp-net-mvc-framework-part-3-passing-viewdata-from-controllers-to-views.aspx">Part 3: Passing ViewData from Controllers to Views</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/12/09/asp-net-mvc-framework-part-4-handling-form-edit-and-post-scenarios.aspx">Part 4: Handling from Edit and Post Scenarios</a></li>
</ul>
</li>
<li><a href="http://forums.asp.net/1146.aspx">MVC Forum</a></li>
<li><a href="http://quickstarts.asp.net/3-5-extensions/mvc/default.aspx">MVC Quickstarts</a></li>
<li><a href="http://weblogs.asp.net/mikebosch/archive/tags/MVC/default.aspx">Tips from Mike Bosch</a></li>
<li><a href="http://www.codeproject.com/KB/aspnet/MvcValidatorToolkit.aspx">Creating Client and Server-Side Form Validation</a> (sample project)</li>
<li><a href="http://www.nikhilk.net/Ajax-MVC.aspx">Ajax with the ASP.NET MVC Framework</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2008/02/12/asp-net-mvc-framework-road-map-update.aspx">Roadmap for MVC Framework</a></li>
</ul>
<h2>Sample Project</h2>
<p>The sample project is a very basic issue tracking system.  The database is not included, but can easily be built according to the following diagram:<br />
<a href='http://shepherdweb.com/wp-content/uploads/2008/02/mvc_databasediagram.jpg' title='database diagram'><img src='http://shepherdweb.com/wp-content/uploads/2008/02/mvc_databasediagram.thumbnail.jpg' alt='database diagram' /> <span>(click to view)</span></a></p>
<p>Have fun! <a href="/lab/2008/LDNUG-MVC/LDNUG-MVC.zip">[Download project files]</a> </p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/ASP.NET" rel="tag">ASP.NET</a>, <a href="http://technorati.com/tag/ASP.NET+MVC" rel="tag"> ASP.NET MVC</a>, <a href="http://technorati.com/tag/ASP.NET+3.5" rel="tag"> ASP.NET 3.5</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2008/02/20/aspnet-mvc-presentation-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Point CompareValidator&#8217;s ControlToCompare Attribute at a HiddenField</title>
		<link>http://shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/</link>
		<comments>http://shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 20:23:29 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/</guid>
		<description><![CDATA[If you point the ControlToCompare attribute of the CompareValidator at a HiddenField you&#8217;ll get an error that looks something like this: Control &#8216;hiddenBalance&#8217; referenced by the ControlToCompare property of &#8216;CompareValidator1&#8242; cannot be validated. With a small amount of &#8220;googling&#8221; I found two useful articles: Validating against the value in a hidden input MS KB Article [...]]]></description>
			<content:encoded><![CDATA[<p>If you point the <code>ControlToCompare</code> attribute of the <code>CompareValidator</code> at a <code>HiddenField</code> you&#8217;ll get an error that looks something like this:</p>
<blockquote><p>Control &#8216;hiddenBalance&#8217; referenced by the ControlToCompare property of &#8216;CompareValidator1&#8242; cannot be validated.</p>
</blockquote>
<p>With a small amount of &#8220;googling&#8221; I found two useful articles:</p>
<ul>
<li><a href="http://www.dotnet247.com/247reference/msgs/55/275332.aspx" title="newsgroup article from microsoft.public.dotnet.framework.aspnet.webcontrols">Validating against the value in a hidden input</a></li>
<li><a href="http://support.microsoft.com/kb/310082" title="How to extend a Web Form control to work with the validation controls by using Visual Basic .NET or Visual Basic 2005">MS KB Article 310082</a></li>
</ul>
<p>Between these two article I pieced together a solution.</p>
<h2>The Solution</h2>
<ol>
<li>Create a new web project and add it to your solution.  I called my project &#8220;CompareValidatorHelper&#8221;.</li>
<li>Right click on the project and select <em>Add</em> and the <em>Class&hellip;</em>.  I also named my class &#8220;CompareValidatorHelper&#8221;.</li>
<li>Paste the following C# code into the class:
<p><code class="block"><br />
using System;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.HtmlControls;<br />
using System.ComponentModel;<br />
namespace CompareValidatorHelper<br />
{<br />
    [DefaultProperty(&quot;Value&quot;), ValidationProperty(&quot;Value&quot;), ToolboxData(&quot;&lt;{0}:VHiddenField runat=server&gt;&lt;/{0}:VHiddenField&gt;&quot;)]<br />
    public class VHiddenField : System.Web.UI.WebControls.HiddenField<br />
    {<br />
    }<br />
}<br />
</code>
</li>
<li>Build the project and add a reference to it in your web application project.</li>
<li>Register the inherited control at the top of your page:<br />
<code class="block">&lt;%@ Register TagPrefix=&quot;custom&quot; Namespace=&quot;CompareValidatorHelper&quot; Assembly=&quot;CompareValidatorHelper&quot; %&gt;</code>
</li>
<li>Add the <code>HiddenField</code> control to your page:<br />
<code class="block">&lt;custom:VHiddenField ID=&quot;hiddenBalance&quot; runat=&quot;server&quot; Value='&lt;%# Eval(&quot;Balance&quot;) %&gt;' /&gt;</code>
</li>
<li>Finally, set the <code>ControlToCompare</code> attribute of your <code>CompareValidator</code> equal to the <code>ID</code> attribute of your <code>HiddenField</code>:<br />
<code class="block">&lt;asp:CompareValidator ID=&quot;CompareValidator1&quot; Display=&quot;Dynamic&quot; runat=&quot;server&quot; Type=&quot;Double&quot; Operator=&quot;LessThanEqual&quot; ErrorMessage=&quot;Overpayments are not allowed.&quot; ControlToCompare=&quot;hiddenBalance&quot; ControlToValidate=&quot;txtPaymentAmount&quot;&gt;*&lt;/asp:CompareValidator&gt;</code>
</li>
</ol>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/ASP.NET" rel="tag">ASP.NET</a>, <a href="http://technorati.com/tag/CompareValidator" rel="tag"> CompareValidator</a>, <a href="http://technorati.com/tag/ControlToCompare" rel="tag"> ControlToCompare</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2007/01/30/how-to-point-comparevalidators-controltocompare-attribute-at-a-hiddenfield/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ASP.NET Membership Provider Gotcha!</title>
		<link>http://shepherdweb.com/2007/01/12/aspnet-membership-provider-gotcha/</link>
		<comments>http://shepherdweb.com/2007/01/12/aspnet-membership-provider-gotcha/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 22:03:04 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2007/01/12/aspnet-membership-provider-gotcha/</guid>
		<description><![CDATA[It turns out that MembershipUser.UserName is a read only property, there is no Set { } method in the Membership Provider, only Get { }. If you try to use Membership.UpdateUser() to change an existing username, you will get the following error: CS0200: Property or indexer &#8216;System.Web.Security.MembershipUser.UserName&#8217; cannot be assigned to &#8212; it is read [...]]]></description>
			<content:encoded><![CDATA[<p>It turns out that <code>MembershipUser.UserName</code> is a read only property, there is no <code>Set { }</code> method in the Membership Provider, only <code>Get { }</code>.  If you try to use <code>Membership.UpdateUser()</code> to change an existing username, you will get the following error:</p>
<blockquote>
<p style="text-align: left;">CS0200: Property or indexer &#8216;System.Web.Security.MembershipUser.UserName&#8217; cannot be assigned to &#8212; it is read only</p>
</blockquote>
<p>Is there any easy way around this?  I&#8217;m sure there is a good reason why Microsoft did this, but why?  </p>
<p><ins datetime="1/12/2007 4:50pm">I found a <a href="http://forums.asp.net/1/1184480/ShowThread.aspx">potential solution</a> in the ASP.NET Forums.</ins></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/ASP.NET" rel="tag">ASP.NET</a>, <a href="http://technorati.com/tag/Membership+Provider" rel="tag"> Membership Provider</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2007/01/12/aspnet-membership-provider-gotcha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing .NET 3.0 Framework on Windows XP SP2</title>
		<link>http://shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/</link>
		<comments>http://shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/#comments</comments>
		<pubDate>Fri, 29 Dec 2006 16:53:20 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[technology & web]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/</guid>
		<description><![CDATA[Why would you want to do this? I&#8217;m not sureyet, but as an ASP.NET developer, I know I&#8217;m probably going to need to understand how to use it. The .NET Framework 3.0 adds new technologies to the .NET Framework 2.0, which makes the .NET Framework 3.0 a superset of the .NET Framework 2.0. You can [...]]]></description>
			<content:encoded><![CDATA[<p>Why would you want to do this?  I&#8217;m not sureyet, but as an ASP.NET developer, I know I&#8217;m probably going to need to understand how to use it. </p>
<blockquote cite="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/netfx30.asp"><p>The .NET Framework 3.0 adds new technologies to the .NET Framework 2.0, which makes the .NET Framework 3.0 a superset of the .NET Framework 2.0. You can think of .NET Framework 3.0 as an &#8220;additive&#8221; release to the .NET Framework 2.0, as contrasted with a generational release where software is revised across the board. (For example, the .NET Framework 2.0 was a generational release over the .NET Framework 1.0.)</p>
</blockquote>
<p>The 3.0 Framework adds four new namespaces to the 2.0 Framework:</p>
<ul>
<li>Windows Communication Foundation (WCF)</li>
<li>Windows Presentation Foundation (WPF)</li>
<li>Windows Workflow Foundation (WF)</li>
<li>Windows Cardspace</li>
</ul>
<p>Reference: <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnlong/html/netfx30.asp">Deploying Microsoft .NET Framework Version 3.0</a></p>
<h2>Overcoming Fear</h2>
<p>So, supposedly the 3.0 Framework is completely &#8220;additive&#8221; and the existing 2.0 Framework remains untouched.  Despite this reassurance, I still felt uncomfortable just installing things willy-nilly.  I felt sure I would find some small print buried on <acronym title="MicroSoft Developers Network">MSDN</acronym> warning us of some critical change to the .NET 2.0 Framework included in 3.0 that would cause all my existing applications to stop working.  Feeling comforted when I couldn&#8217;t find any warnings and pressured by the need to prepare for the rapidly approaching <a href="http://www.communitylaunch.net/">Community Launch Event</a>, I proceeded.</p>
<h2>Proceeding</h2>
<p>First, <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=10CC340B-F857-4A14-83F5-25634C3BF043&#038;displaylang=en">download</a> the framework and run dotnetfx3setup.exe.  This will download 30 MB and install the &#8220;additive(s)&#8221; for you.</p>
<div style="overflow: auto; height: 1%;">
<a class="imagelink" style="float: left; border: 3px double #666;margin: 8px;" href="http://www.shepherdweb.com/wp-content/uploads/2006/12/1-DownloadProgress.jpg" title="Downloading"><img id="image96" src="http://www.shepherdweb.com/wp-content/uploads/2006/12/1-DownloadProgress.thumbnail.jpg" alt="Downloading" /></a><a style="float: left; border: 3px double #666;margin: 8px;" class="imagelink" href="http://www.shepherdweb.com/wp-content/uploads/2006/12/2-Installing%20%28this%20takes%20a%20while%29.jpg" title="Installing .NET 3.0 Framework"><img id="image97" src="http://www.shepherdweb.com/wp-content/uploads/2006/12/2-Installing%20%28this%20takes%20a%20while%29.thumbnail.jpg" alt="Installing .NET 3.0 Framework" /></a><a style="float: left; border: 3px double #666;margin: 8px;" class="imagelink" href="http://www.shepherdweb.com/wp-content/uploads/2006/12/3-Success.jpg" title="You did it!"><img id="image98" src="http://www.shepherdweb.com/wp-content/uploads/2006/12/3-Success.thumbnail.jpg" alt="You did it!" /></a>
</div>
<p>You&#8217;re done!  The .NET 3.0 Runtime Components are now installed!</p>
<p>My first action after installation was to open all my current projects and make sure they all still run.  Sure enough, everything still works!</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/WinFX" rel="tag">WinFX</a>, <a href="http://technorati.com/tag/.NET+3.0" rel="tag"> .NET 3.0</a>, <a href="http://technorati.com/tag/ASP.NET" rel="tag"> ASP.NET</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2006/12/29/installing-net-30-framework-on-windows-xp-sp2/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>ASP.NET AJAX Control Toolkit AnimationExtender Using a Condition</title>
		<link>http://shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/</link>
		<comments>http://shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/#comments</comments>
		<pubDate>Wed, 13 Dec 2006 01:03:00 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET AJAX]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/</guid>
		<description><![CDATA[The ASP.NET AJAX Control Toolkit includes a control called the AnimationExtender which provides a framework for adding animation effects to web pages. One ability of the AnimationExtender is to execute code based on a condition using the Condition Animation rules. Condition Animation will &#8220;play&#8221; specific child animations based on the boolean result of the conditionScript. [...]]]></description>
			<content:encoded><![CDATA[<p>The ASP.NET AJAX Control Toolkit includes a control called the <a href="http://ajax.asp.net/ajaxtoolkit/Animation/Animation.aspx">AnimationExtender</a> which provides a framework for adding animation effects to web pages.  One ability of the AnimationExtender is to execute code based on a condition using the <a href="http://ajax.asp.net/ajaxtoolkit/Walkthrough/AnimationReference.aspx#ConditionAnimation">Condition Animation</a> rules.  Condition Animation will &#8220;play&#8221; specific child animations based on the boolean result of the <code>conditionScript</code>.</p>
<div style="margin: 6px 0; padding: 6px 8px; border: 1px solid #bbb; background-color: #eee;"><a href="http://www.shepherdweb.com/wp-content/uploads/2006/12/AnimationExtenderDemo.aspx.zip">Download Animation Extender Demo Code</a> <span class="meta">(4k .zip)</span></div>
<h2>What it does&#8230;</h2>
<p>If a checkbox is checked then the <code>backgroundColor</code> of the <code>parentNode</code> is changed to add emphasis to the checked items.  The <code>conditionScript</code> is <code>true</code> causing the <em>first</em> child animation to play.<br />
<img style="margin: 0 50px;" src="http://www.shepherdweb.com/wp-content/uploads/2006/12/screenshot2.jpg" alt="Animation Extender Demo - after" /></p>
<p>When a checkbox is unchecked, the <code>backgroundColor</code> is reset.  The <code>conditionScript</code> returns <code>false</code> causing the <em>second</em> child animation to play.</p>
<p><img style="margin: 0 50px;" src="http://www.shepherdweb.com/wp-content/uploads/2006/12/screenshot1.jpg" alt="Animation Extender Demo - before" /></p>
<h2>Code Snippet&#8230;</h2>
<p><code class="block"><br />
&lt;asp&#58;CheckBox ID=&quot;chk1&quot; runat=&quot;server&quot; Text=&quot;Puppy&quot; &#47;&gt;<br />
&lt;cc1&#58;AnimationExtender ID=&quot;AnimationExtender1&quot; runat=&quot;server&quot; TargetControlID=&quot;chk1&quot;&gt;<br />
    &lt;Animations&gt;<br />
        &lt;OnClick&gt;<br />
            &lt;Condition ConditionScript=&quot;document.getElementById(&#39;chk1&#39;).checked&#59;&quot;&gt;<br />
                &lt;ScriptAction Script=&quot;document.getElementById(&#39;chk1&#39;).parentNode.style.backgroundColor = &#39;#ADDA59&#39;&#59;&quot; &#47;&gt;<br />
                &lt;ScriptAction Script=&quot;document.getElementById(&#39;chk1&#39;).parentNode.style.backgroundColor = &#39;#FFFFFF&#39;&#59;&quot; &#47;&gt;<br />
            &lt;&#47;Condition&gt;<br />
        &lt;&#47;OnClick&gt;<br />
    &lt;&#47;Animations&gt;<br />
&lt;&#47;cc1&#58;AnimationExtender&gt;<br />
</code></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/ASP.NET" rel="tag">ASP.NET</a>, <a href="http://technorati.com/tag/AJAX" rel="tag"> AJAX</a>, <a href="http://technorati.com/tag/AnimationExtender" rel="tag"> AnimationExtender</a>, <a href="http://technorati.com/tag/conditionScript" rel="tag"> conditionScript</a>, <a href="http://technorati.com/tag/tutorial" rel="tag"> tutorial</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2006/12/12/aspnet-ajax-animationextender-using-a-condition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Handling Google Maps API Keys with ASP.NET MasterPages and Web.config</title>
		<link>http://shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/</link>
		<comments>http://shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 21:03:35 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[technology & web]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/</guid>
		<description><![CDATA[The Google Maps API requires you to generate a key that is tied to the URL where the map will be deployed. This can be inconvenient if the site exists in multiple places at the same time&#8230;as is the case in many development scenarios: Develop Test Deploy These three stages can also represent physical locations. [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.google.com/apis/maps/">Google Maps API</a> requires you to generate a key that is tied to the URL where the map will be deployed.  This can be inconvenient if the site exists in multiple places at the same time&#8230;as is the case in many development scenarios:</p>
<ol>
<li>Develop</li>
<li>Test</li>
<li>Deploy</li>
</ol>
<p>These three stages can also represent physical locations.  Development is done locally, moved to an internal testing server for QA, and finally deployed to the production server.  There is frequently a lot of overlap between these stages and locations as bugs are discovered and ironed out or new features added.  Managing multiple Google Maps API Keys between all these URL&#8217;s can be a hassle.</p>
<h2>The Trick</h2>
<p><a href="http://www.google.com/apis/maps/signup.html">Sign up for the Google Maps API</a> for every URL the site will exist on.   Add the keys to the appSettings section of Web.config.<br />
<code class="block"><br />
  &lt;appSettings&gt;<br />
    &lt;!-- Google Map API Keys --&gt;<br />
    &lt;add key=&quot;localhost&quot; value=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAALZp8x8mYJMinyKDbF6G7bBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxQBOooHv6EDaUJi3lHupS34T4CM5Q&quot;/&gt;<br />
    &lt;add key=&quot;testserver&quot; value=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAALZp8x8mYJMinyKDbF6G7bBT4S2onT7717RtVeZs20MVAELzRRBSlPqEN-WtDpPooS4i4Rvu50CucoA&quot;/&gt;<br />
    &lt;add key=&quot;www.productionserver.com&quot; value=&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=ABQIAAAALZp8x8mYJMinyKDbF6G7bBQzDH33YNyRzvKBWbxIa_7sg2mVwBRnO7qb_i1DY0Vhq-a8wXtFVXcMkg&quot;/&gt;<br />
  &lt;/appSettings&gt;<br />
</code></p>
<p>Now, register the script in the code behind for the page that needs it.</p>
<p><code class="block"><br />
protected void Page_Init(object sender, EventArgs e)<br />
{<br />
    if (!Page.IsStartupScriptRegistered(&quot;googleMapScript&quot;))<br />
    {<br />
        // Register Startup Script for Google Maps API<br />
        string myScript = &quot;&lt;script type=\&quot;text/javascript\&quot; src=\&quot;&quot; + ConfigurationManager.AppSettings[Request.ServerVariables[&quot;SERVER_NAME&quot;]] + &quot;\&quot;&gt;&lt;/script&gt;&quot;;<br />
        this.Page.ClientScript.RegisterStartupScript(typeof(Page), &quot;googleMapScript&quot;, myScript);<br />
    }<br />
}<br />
</code></p>
<p>You&#8217;re done!</p>
<p>PS: I know my code blocks are not too hip right now (overflowing onto the navigation and sidebar).  It&#8217;s on the list.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/Google+Map+API+Key" rel="tag">Google Map API Key</a>, <a href="http://technorati.com/tag/ASP.NET" rel="tag"> ASP.NET</a>, <a href="http://technorati.com/tag/RegisterStartupScript" rel="tag"> RegisterStartupScript</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2006/12/08/handling-google-maps-api-keys-with-aspnet-masterpages-and-webconfig/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

