<?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 AJAX</title>
	<atom:link href="http://shepherdweb.com/category/web-code/aspnet/aspnet-ajax/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 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>Adding an OnClick Event to a RadioButtonList ListItem</title>
		<link>http://shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/</link>
		<comments>http://shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 22:28:40 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[ASP.NET AJAX]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/</guid>
		<description><![CDATA[The ASP.NET RadioButtonList does not provide a declarative way to attach the onclick attribute to a ListItem. However, it can be done using the OnDataBound event handler. This is useful in a scenario where you have a TextBox that you would like to populate with the user&#8217;s RadioButtonList SelectedValue. In this example, I&#8217;m using the [...]]]></description>
			<content:encoded><![CDATA[<p>The ASP.NET RadioButtonList does not provide a declarative way to attach the onclick attribute to a ListItem.  However, it can be done using the OnDataBound event handler.  This is useful in a scenario where you have a TextBox that you would like to populate with the user&#8217;s RadioButtonList SelectedValue.  In this example, I&#8217;m using the ASP.NET AJAX ModalPopupExtender which contains the RadioButtonList.</p>
<h2>.aspx</h2>
<p>I&#8217;m populating RadioButtonList with a list of currently visible pages in the CMS application this code resides in.  The ModalPopup is triggered by a LinkButton (lnkBrowseUrls).</p>
<p><code class="block"><br />
 &lt;asp:Panel ID=&quot;pnlUrlFinder&quot; runat=&quot;server&quot; CssClass=&quot;popupBox&quot;&gt;<br />
    &lt;div&gt;<br />
        &lt;asp:SqlDataSource<br />
            ID=&quot;sqlPages&quot;<br />
            runat=&quot;server&quot;<br />
            ConnectionString=&quot;&lt;%$ ConnectionStrings:MyConnection %&gt;&quot;<br />
            ProviderName=&quot;System.Data.SqlClient&quot;<br />
            SelectCommand=&quot;SELECT * FROM pages WHERE page_visible=1&quot;&gt;<br />
        &lt;/asp:SqlDataSource&gt;<br />
         &lt;asp:RadioButtonList<br />
            runat=&quot;server&quot;<br />
            ID=&quot;radioUrls&quot;<br />
            DataSourceID=&quot;sqlPages&quot;<br />
            DataTextField=&quot;page_title&quot;<br />
            DataValueField=&quot;page_id&quot;<br />
            OnDataBound=&quot;radioUrls_OnDataBound&quot;&gt;<br />
        &lt;/asp:RadioButtonList&gt;<br />
    &lt;/div&gt;<br />
    &lt;asp:LinkButton ID=&quot;lnkCloseUrlFinder&quot; runat=&quot;server&quot; Text=&quot;Close&quot; /&gt;<br />
&lt;/asp:Panel&gt;<br />
</code><br />
<code class="block"><br />
&lt;cc1:ModalPopupExtender<br />
    ID=&quot;ModalPopupExtender1&quot;<br />
    runat=&quot;server&quot;<br />
    TargetControlID=&quot;lnkBrowseUrls&quot;<br />
    PopupControlID=&quot;pnlUrlFinder&quot;<br />
    OkControlID=&quot;radioUrls&quot;<br />
    CancelControlID=&quot;lnkCloseUrlFinder&quot;&gt;<br />
&lt;/cc1:ModalPopupExtender&gt;<br />
</code></p>
<h2>.aspx.cs</h2>
<p>The OnDataBound event handler creates the onclick event on each ListItem which populates a TextBox with the path to the given page.  (I&#8217;m using <a href="http://cheeso.members.winisp.net/IIRF.aspx">Ionic&#8217;s ISAPI Rewrite Filter</a> to rewrite url&#8217;s so they are &#8220;Search Engine Friendly&#8221;.)<br />
<code class="block"><br />
    protected void radioUrls_OnDataBound(object sender, EventArgs e)<br />
    {<br />
        RadioButtonList rbl = (RadioButtonList)sender;<br />
        foreach (ListItem li in rbl.Items)<br />
        {<br />
            string s = &quot;document.getElementById('&quot; + txtUrl.ClientID + &quot;').value = '&quot; + Request.ApplicationPath + &quot;/page/view/&quot; + li.Value + &quot;/'&quot;;<br />
            li.Attributes.Add(&quot;onclick&quot;, s);<br />
        }<br />
    }<br />
</code></p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/" border="0" alt="kick it on DotNetKicks.com" /></a></p>
<div class="techtags"><p>Technorati Tags: <a href="http://technorati.com/tag/RadioButtonList" rel="tag">RadioButtonList</a>, <a href="http://technorati.com/tag/OnClick" rel="tag"> OnClick</a>, <a href="http://technorati.com/tag/ASP.NET" rel="tag"> ASP.NET</a>, <a href="http://technorati.com/tag/ASP.NET+AJAX" rel="tag"> ASP.NET AJAX</a>, <a href="http://technorati.com/tag/ModalPopup" rel="tag"> ModalPopup</a>, <a href="http://technorati.com/tag/ModalPopupExtender" rel="tag"> ModalPopupExtender</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2006/11/22/adding-an-onclick-event-to-a-radiobuttonlist-listitem/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Safari and Firefox Support Improved in ASP.NET AJAX Beta2</title>
		<link>http://shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/</link>
		<comments>http://shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 14:37:40 +0000</pubDate>
		<dc:creator>Shane</dc:creator>
				<category><![CDATA[ASP.NET AJAX]]></category>

		<guid isPermaLink="false">http://www.shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/</guid>
		<description><![CDATA[Beta2 release of ASP.NET AJAX (formerly known as &#8220;Atlas&#8221;) was released on Monday. Scott Guthrie has an overview of the highlights of this release. Notable among them is added support for drag and drop ASP.NET 2.0 web parts in Safari and Firefox. David Barkol explains how to add this support to existing ASP.NET AJAX applications. [...]]]></description>
			<content:encoded><![CDATA[<p>Beta2 release of <a href="http://ajax.asp.net/">ASP.NET AJAX</a> (formerly known as &#8220;Atlas&#8221;) was released on Monday.  Scott Guthrie has an <a href="http://weblogs.asp.net/scottgu/archive/2006/11/08/ASP.NET-AJAX-1.0-Beta-2-Release.aspx">overview of the highlights</a> of this release.  Notable among them is added support for drag and drop ASP.NET 2.0 web parts in Safari and Firefox.  <a href="http://blogs.neudesic.com/blogs/david_barkol/archive/2006/11/07/631.aspx">David Barkol explains</a> how to add this support to existing ASP.NET AJAX applications.  Also, the updateProgress control is now fully supported and included in the core download and enablePartialRendering has been upgraded to gracefully auto-degrade for AJAX incapable browsers.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http://www.shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://www.shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/" 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/Safari" rel="tag"> Safari</a>, <a href="http://technorati.com/tag/Firefox" rel="tag"> Firefox</a>, <a href="http://technorati.com/tag/updateProgress" rel="tag"> updateProgress</a>, <a href="http://technorati.com/tag/enablePartialRendering" rel="tag"> enablePartialRendering</a></p></div>
]]></content:encoded>
			<wfw:commentRss>http://shepherdweb.com/2006/11/09/safari-and-firefox-support-improved-in-aspnet-ajax-beta2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

