
<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Change a CSS Control Adapter in Code</title>
	<atom:link href="http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/</link>
	<description>We should be taught not to wait for inspiration to start a thing. Action always generates inspiration. Inspiration seldom generates action.</description>
	<lastBuildDate>Wed, 04 Aug 2010 10:46:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Remy Blaettler</title>
		<link>http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/comment-page-1/#comment-15355</link>
		<dc:creator>Remy Blaettler</dc:creator>
		<pubDate>Sun, 14 Dec 2008 18:14:04 +0000</pubDate>
		<guid isPermaLink="false">http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/#comment-15355</guid>
		<description>Glad I could help. And thanks for sharing this with us. I never tried it in a Master Page.</description>
		<content:encoded><![CDATA[<p>Glad I could help. And thanks for sharing this with us. I never tried it in a Master Page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan</title>
		<link>http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/comment-page-1/#comment-15353</link>
		<dc:creator>Alan</dc:creator>
		<pubDate>Fri, 12 Dec 2008 17:07:59 +0000</pubDate>
		<guid isPermaLink="false">http://remy.supertext.ch/2008/11/change-a-css-control-adapter-in-code/#comment-15353</guid>
		<description>This is great! Exactly what I am looking for. It appears that if you use a master page, however, it won&#039;t use the control adapter on the very first request even if the code is in the init of the master page - each request thereafter works, though. You can, however put it in the BeginRequest of your global.asax and it will be run for every request including the first, like so...

        Dim controlType As String = GetType(ImageButton).AssemblyQualifiedName
        If Not HttpContext.Current.Request.Browser.Adapters.Contains(controlType) Then
            HttpContext.Current.Request.Browser.Adapters.Add(controlType, &quot;MyNamespace.MyImageBtnAdapter&quot;)
        End If

In my project, I made it a little more robust allowing me to change the adapters on the fly (both add and remove) from settings in a database.

Thanks!!!</description>
		<content:encoded><![CDATA[<p>This is great! Exactly what I am looking for. It appears that if you use a master page, however, it won&#8217;t use the control adapter on the very first request even if the code is in the init of the master page &#8211; each request thereafter works, though. You can, however put it in the BeginRequest of your global.asax and it will be run for every request including the first, like so&#8230;</p>
<p>        Dim controlType As String = GetType(ImageButton).AssemblyQualifiedName<br />
        If Not HttpContext.Current.Request.Browser.Adapters.Contains(controlType) Then<br />
            HttpContext.Current.Request.Browser.Adapters.Add(controlType, &#8220;MyNamespace.MyImageBtnAdapter&#8221;)<br />
        End If</p>
<p>In my project, I made it a little more robust allowing me to change the adapters on the fly (both add and remove) from settings in a database.</p>
<p>Thanks!!!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
