<?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>Dahlin Development - Blog &#187; Uncategorized</title>
	<atom:link href="http://blog.dahlindevelopment.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dahlindevelopment.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 14:17:17 +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>Setting GroupName of RadioButton in ListView</title>
		<link>http://blog.dahlindevelopment.com/2010/12/setting-groupname-of-radiobutton-in-listview/</link>
		<comments>http://blog.dahlindevelopment.com/2010/12/setting-groupname-of-radiobutton-in-listview/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 23:35:52 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.dahlindevelopment.com/?p=373</guid>
		<description><![CDATA[Problem: It seems there is a bug in asp.net where if you add a radio button to a control such as a ListView, Repeater, etc, the GroupName will not be the same for every RadioButton because of the asp.net naming convention adding the control hierarchy to the name. For example I have a ListView that [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem:</strong> It seems there is a bug in asp.net where if you add a radio button to a control such as a ListView, Repeater, etc, the GroupName will not be the same for every RadioButton because of the asp.net naming convention adding the control hierarchy to the name.</p>
<p>For example I have a ListView that I include a RadioButton with the ID of “rbMorning”.   3 ListItems are dynamically created with a rendered output name of:</p>
<pre>name="ctl00$cphMain$lvMorningSessions$ctrl0$rbMorning"</pre>
<pre>name="ctl00$cphMain$lvMorningSessions$ctrl1$rbMorning"</pre>
<pre>and</pre>
<pre>name="ctl00$cphMain$lvMorningSessions$ctrl2$rbMorning"</pre>
<pre></pre>
<p>In this case a user would be allowed to select all 3 RadioButtons, defeating the purpose of using a RadioButton control.</p>
<p>
<strong>Solution: </strong>Update the names with jQuery.  You will notice that that each name ends with the id of the RadioButton that you set in the ListView.  So I basically search for that and update the name to a name that all radio buttons will share.</p>
<p>Just a few lines of code to do this.  It all is included right here.  I am assuming you need to add jQuery to the page here as well.</p>
<pre class="brush: xml; title: ; notranslate">
    &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js&quot;&gt;&lt;/script&gt;
    &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
        $(document).ready(function () {
            $('input[name$=&quot;rbMorning&quot;]').attr('name', 'rbMorning');
        });
    &lt;/script&gt;
</pre>
<p>That&#8217;s it. I hope this helps someone. I am really surprised this is still an issue in asp.net 4.0 even.</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fblog.dahlindevelopment.com%2F2010%2F12%2Fsetting-groupname-of-radiobutton-in-listview%2F&amp;title=Setting%20GroupName%20of%20RadioButton%20in%20ListView" id="wpa2a_2"><img src="http://blog.dahlindevelopment.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.dahlindevelopment.com/2010/12/setting-groupname-of-radiobutton-in-listview/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hello World</title>
		<link>http://blog.dahlindevelopment.com/2009/03/hello-world/</link>
		<comments>http://blog.dahlindevelopment.com/2009/03/hello-world/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 04:34:37 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.dahlindevelopment.com/?p=6</guid>
		<description><![CDATA[What you can expect to read on my blog.]]></description>
			<content:encoded><![CDATA[<p>After almost one year of being a business I finally have launched my site and blog. It is still a work in progress but I have the main content up.</p>
<p><strong>What can you expect to read on my blog?</strong><br />
I&#8217;ll be blogging about how I run my business, tools I use, resources I reference, and other things I encounter. I&#8217;ll also be blogging about the technology I use and of course CODE. I hope to give everyone a better idea of what all I do.</p>
<p>Look for some great stuff to come!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dahlindevelopment.com/2009/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

