<feed xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Cadred.NET</title>
    <link rel="self" type="application/atom+xml" href="http://cadred.net/blog/Atom.aspx" />
    <subtitle type="html">Life as an independant developer</subtitle>
    <id>http://cadred.net/blog/Default.aspx</id>
    <author>
        <name>Michael Cook</name>
        <uri>http://cadred.net/blog/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 2.0.0.0">Subtext</generator>
    <updated>2008-08-19T14:44:01Z</updated>
    <entry>
        <title>Site Maintenance</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/08/19/site-maintenance.aspx" />
        <id>http://cadred.net/blog/archive/2008/08/19/site-maintenance.aspx</id>
        <published>2008-08-19T14:44:01Z</published>
        <updated>2008-08-19T14:44:01Z</updated>
        <content type="html">&lt;p&gt;Sorry for the extended downtime. I was performing an upgrade to the fresh and minty &lt;a href="http://haacked.com/archive/2008/08/10/subtext-2.0-released.aspx"&gt;Subtext 2.0&lt;/a&gt; which ran into a few issues. Things are better now, so thanks for &lt;a href="http://haacked.com"&gt;Phil&lt;/a&gt; and crew for making some great (if hard to install) software!&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/1008.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/1008.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/1008.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/1008.aspx</trackback:ping>
    </entry>
    <entry>
        <title>The Perfect Work Week</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/07/02/the-perfect-work-week.aspx" />
        <id>http://cadred.net/blog/archive/2008/07/02/the-perfect-work-week.aspx</id>
        <published>2008-07-02T16:26:49Z</published>
        <updated>2008-07-02T16:26:49Z</updated>
        <content type="html">&lt;p&gt;&lt;a href="http://cookfamilystl.com/blog/archive/2008/07/02/back-from-the-east-coast.aspx"&gt;The family&lt;/a&gt; and I just got back from North East, MD visiting family. So Monday was traveling, I took off Tuesday to recuperate (yes, a vacation from my vacation) and Wednesday was our new work from home day. I go into the office tomorrow, but of course Friday is the 4th of July holiday.&lt;/p&gt;  &lt;p&gt;Or as I like to call it, the perfect work week.&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/1000.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/1000.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/1000.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/1000.aspx</trackback:ping>
    </entry>
    <entry>
        <title>No Java Here</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/04/08/no-java-here.aspx" />
        <id>http://cadred.net/blog/archive/2008/04/08/no-java-here.aspx</id>
        <published>2008-04-08T11:35:05Z</published>
        <updated>2008-04-08T11:35:05Z</updated>
        <content type="html">&lt;p&gt;Turns out we lost the Java job we were looking forward too, bummer. I guess we won't all be Java developers quite yet.&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/986.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/986.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/986.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/986.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Java IDE's</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/03/19/java-ides.aspx" />
        <id>http://cadred.net/blog/archive/2008/03/19/java-ides.aspx</id>
        <published>2008-03-19T12:35:14Z</published>
        <updated>2008-03-19T12:35:14Z</updated>
        <content type="html">&lt;p&gt;Being new to the Java scene, one of the first tasks in picking up Java is determining an IDE to use. The main contenders seem to be &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;, &lt;a href="http://www.netbeans.org/"&gt;Netbeans&lt;/a&gt;, and &lt;a href="http://www.jetbrains.com/idea/"&gt;IntelliJ IDEA&lt;/a&gt;. I cannot say one is universally better than another, but when trying to evaluate them for our needs a few things stuck out.&lt;/p&gt;  &lt;h4&gt;Eclipse&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Can do anything, be anything with the proper plugins.&lt;/li&gt;    &lt;li&gt;Free&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;Everything&lt;/strong&gt; requires a plugin, all of which have differing levels of quality, stability, and usability.&lt;/li&gt;    &lt;li&gt;Not all plugins are free.&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Netbeans&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Best out-of-the-box experience.&lt;/li&gt;    &lt;li&gt;Most "VisualStudio-Like".&lt;/li&gt;    &lt;li&gt;Visual Designer tools for JSF.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Not quite as well supported in the community (not as many plugins).&lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;IntelliJ IDEA&lt;/h4&gt;  &lt;p&gt;&lt;strong&gt;Pros&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Powerful refactoring tools.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Cons&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Commercial (not free).&lt;/li&gt;    &lt;li&gt;Some features required additional setup (I could not get Tomcat working, boo).&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Overall, we are leaning towards Netbeans at the moment, with IntelliJ IDEA as a runner up. Getting Eclipse configured with all of the proper plugins seems like too much of a barrier for entry.  &lt;/p&gt;  &lt;p&gt;The Visual Designer tools in Netbeans aren't much of a plus for me as I don't normally like designer tools in production, but they are helpful when you are learning your way around a new platform.&lt;/p&gt;  &lt;p&gt;After we choose an IDE the next will be choosing a web framework. With JSP, Struts, Spring, and JSF to choose from, it's a crowded field. JSF seems to be the bees-knees, but Spring has it's supporters too. Even limiting the decision to JSF, there are over 50 implementations out there, each with it's own specialty/features/quirks. That's quite a lot to choose from. &lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/983.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/983.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/983.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/983.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Life as a Java Developer</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/03/14/life-as-a-java-developer.aspx" />
        <id>http://cadred.net/blog/archive/2008/03/14/life-as-a-java-developer.aspx</id>
        <published>2008-03-14T10:07:19Z</published>
        <updated>2008-03-14T11:06:11Z</updated>
        <content type="html">&lt;p&gt;In a stunning turn of events I get to be a Java developer for a while. We have a big client project (which we are all very excited to work on) that has to be done in Java as dictated by the needs of the client, which I can understand. It seems most people seem to go from Java to .Net, but for me it's the other way around. It will be interesting to see the other side of the fence.&lt;/p&gt;  &lt;p&gt;It's a little intimidating, but I'm excited by the opportunity to learn a new (to me) technology.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.cadred.net/blog/Images/cadred_net/LifeasaJavaDeveloper_8EE5/322pxJava_Logo.svg.png"&gt;&lt;img height="240" alt="322px-Java_Logo.svg" src="http://www.cadred.net/blog/Images/cadred_net/LifeasaJavaDeveloper_8EE5/322pxJava_Logo.svg_thumb.png" width="129" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/981.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/981.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/981.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/981.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Still Here</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/02/28/still-here.aspx" />
        <id>http://cadred.net/blog/archive/2008/02/28/still-here.aspx</id>
        <published>2008-02-28T10:42:22Z</published>
        <updated>2008-02-28T10:42:22Z</updated>
        <content type="html">&lt;p&gt;I'm still here, I have not disappeared again. I have several posts in the pipeline, but I am still trying to establish better posting habits.&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/977.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/977.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/977.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/977.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Case of the missing Postback in IE</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/02/12/case-of-the-missing-postback-in-ie.aspx" />
        <id>http://cadred.net/blog/archive/2008/02/12/case-of-the-missing-postback-in-ie.aspx</id>
        <published>2008-02-12T16:17:15Z</published>
        <updated>2008-02-12T16:26:21Z</updated>
        <content type="html">&lt;p&gt;Here's one with a simple solution that took me way longer to figure out than it should have.&lt;/p&gt;  &lt;p&gt;We recently ported our internal intranet over to ASP.NET 2 (I know it's 2008, but it was a big project). For the most part this went smoothly, but a few minor issues appeared. One of these issues was with a custom server control that managed data paging. The control would draw the appropriate number of link buttons, when a button was clicked it generated a postback and called a SelectedPageChanged event to do whatever was required. &lt;/p&gt;  &lt;p&gt;Because this is a custom control, I had to manually wire up the postback event:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;newLinkBtn.Attributes.Add(&lt;span class="str"&gt;"onclick"&lt;/span&gt;, &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    Page.ClientScript.GetPostBackEventReference(&lt;span class="kwrd"&gt;this&lt;/span&gt;, argument));&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;style type="text/css"&gt;&lt;![CDATA[






.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;style type="text/css"&gt;&lt;![CDATA[







.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;This worked great in ASP.NET 1.1, and even after the port worked fine in Firefox and Safari. IE however showed some very strange behavior. It was refreshing the page but nothing was happening, which is very strange considering the code was all server side. There shouldn't have been any differences in browser behavior.&lt;/p&gt;

&lt;p&gt;My first step was to update the code to use the ASP.NET 2 ClientScript tools:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;newLinkBtn.OnClientClick = &lt;/pre&gt;

  &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    Page.ClientScript.GetPostBackClientHyperlink(&lt;span class="kwrd"&gt;this&lt;/span&gt;, argument);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;Which didn't help. Stepping through the debugger, I saw that the page lifecycle was happening twice. The first time everything happened as expected, however the second time, everything defaulted back to the first load. This left me scratching my head for a while (longer than I cared to admit). I wish I could say I came up with the solution myself, but some googling led me to &lt;a href="http://www.msdner.net/asp.net-archived/114/34-1009-1147828.shtm"&gt;this post on msdner.net&lt;/a&gt;.  Simply appending a return statement solved my problem:&lt;/p&gt;

&lt;div class="csharpcode"&gt;
  &lt;div class="csharpcode"&gt;
    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;newLinkBtn.OnClientClick = &lt;/pre&gt;

    &lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;    Page.ClientScript.GetPostBackClientHyperlink(&lt;span class="kwrd"&gt;this&lt;/span&gt;, argument);   &lt;/pre&gt;

    &lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;newLinkBtn.OnClientClick += &lt;span class="str"&gt;";return false;"&lt;/span&gt;;&lt;/pre&gt;
  &lt;/div&gt;
  &lt;style type="text/css"&gt;&lt;![CDATA[


.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;&lt;/div&gt;
&lt;style type="text/css"&gt;&lt;![CDATA[






.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }]]&gt;&lt;/style&gt;

&lt;p&gt;In a nutshell, if you manually wire up a GetPostBackClientHyperLink (or GetPostBackEventReference), it will no longer provide a safety return statement. I could get mad at this behavior, but I see some benefit in being able to chain your own javascript to the PostBack event... if it worked consistently in all browsers. As it is this behavior only cropped up in IE (both 6 and 7), which made it quite a pain to figure out.&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/970.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/970.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/970.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/970.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Back among the Living</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2008/02/11/back-among-the-living.aspx" />
        <id>http://cadred.net/blog/archive/2008/02/11/back-among-the-living.aspx</id>
        <published>2008-02-11T10:27:39Z</published>
        <updated>2008-02-11T10:27:39Z</updated>
        <content type="html">So here it is, over two years since my last post. I've been quite busy in the meantime. &lt;a href="http://www.emilyandmike.net"&gt;Marriage&lt;/a&gt;, new house, a &lt;a href="http://www.flickr.com/photos/cookfamilystl/1268870867/in/set-72157602475922021/"&gt;puppy&lt;/a&gt;, and oh, a &lt;a href="http://flickr.com/cookfamilystl"&gt;baby&lt;/a&gt;! You can ready all about them at our new blog over at &lt;a href="http://cookfamilystl.com"&gt;cookfamilystl.com&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Please bare with me as I dust off the cobwebs and refocus my blog on my. I intend to be a bit more regular updating, though I'm still working out on just how often that will be, but I'm aiming for at least twice a week.&lt;br /&gt;
&lt;br /&gt;
Even though I have over 8 years of experience under my belt, I consider this very much a learning blog. I would like to share my thoughts as I explore programming and development and I hope I can share some of my passion or even inspire others in the process.&lt;br /&gt;
&lt;br /&gt;
Thank you for reading.&lt;img src="http://cadred.net/blog/aggbug/969.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/969.aspx</wfw:comment>
        <slash:comments>0</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/969.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/969.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Dynamic Server Controls &amp; INamingContainer</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2005/03/16/260.aspx" />
        <id>http://cadred.net/blog/archive/2005/03/16/260.aspx</id>
        <published>2005-03-16T19:50:00Z</published>
        <updated>2005-04-18T19:22:00Z</updated>
        <content type="html">It turns out that creating a custom server control that uses dynamic
controls (controls added at runtime) is a huge pain in the ass. Add to
that INamingContainer, which is virtually a necessity when making a
composite control (it lets you have more than one copy of the server
control on the page by guaranteeing that the child controls have unique
id's) completely screws around with control's life-cycle, and you have
one frustrated developer..&lt;br&gt;
&lt;br&gt;
It's taken me entirely too long to create my data-paging server
control, which simply creates the buttons you need to page through data
(First, Prev, 1, 2, 3, Next, Last - etc) and provides an event for when
the user clicks a button. It doesn't do the actual data-paging, just
the controls so it should have been a simple control to write. Nope, I
had to try just about every trick and lame technique in the book to get
it to work the way I want. Along the way I tried such things as
serializing out the settings to a hidden field (essentially creating my
own custom viewstate), so that I could re-instantiate my controls
before the events are supposed to fire. Turns out that way doesn't work
so hot if you need to hide the control for whatever reason (hidden
panel, etc), since the hidden field won't get included in the page. I
also tried to tap into virtually every part of the control's
life-cycle, which ultimately useless, turned out to be good for learning
how things worked, inserting hidden fields, or creating and re-creating
controls at different points.&lt;br&gt;
&lt;br&gt;
Finally I have something that works, though it's not without it's share
of shortcuts. I ultimately borrowed some idea and code from Dennis
Bauer's DynamicControlsPlaceHolder, to re-create my dynamic controls
out of the viewstate on a postback. The downside to this technique is
that it doesn't re-wire the events properly, and even worse, you loose
command arguments (which is what I used to determine which page button
the user clicked on). So I had to work around that by storing some
extra info into the persistenceString (a string that is passed along
that tracks which controls to restore).&lt;br&gt;
&lt;br&gt;
So once the control is loaded, I override CreateChildControls to create
the final controls the user sees. I do this by calling
this.Controls.Clear() to wipe out the controls that were created by
from the viewstate (which could be different depending on which page
the user clicked on). It's not great, but it's much easier and probably
faster than comparing the new controls that will be generated to the
existing ones and adding or removing ones that don't match up. &lt;br&gt;
&lt;br&gt;
It would be nice if there was some way to detect which button was
clicked so I could only restore that control to capture the event, but
I don't know if that's possible. So it now works with only
instantiating the controls a maximum of twice
per page load, which is an improvement over earlier versions.&lt;br&gt;
&lt;br&gt;
All of the leaves my final workaround for INamingContainer. As
mentioned above using INamingContainer causes the control life-cycle
events to be called in a different order. This meant that my
CreateChildControls was being called after my event was firing, the
event which set the current page that the CreateChildControls relied
upon. That was a problem. I could have forced a call to re-create the
child controls after my event fired, but that would be adding a lot of
overhead to an already inefficient system by having to re-create the
controls 3 times instead of two.&lt;br&gt;
&lt;br&gt;
So I ended up manually setting all of the control id's so that they
used the parent control's ClientID. This was essentially what
INamingContainer did, sans the odd life-cycle changes. It wasn't as big
a deal as it could have been since I had to explicitly set the control
id's for the DynamicControlsPlaceHolder code to work anyway.&lt;br&gt;
&lt;br&gt;
It's not pretty, but it works. I can put as many pagingcontrols on a
page as I want (say at the top and bottom of a repeater), even hide
them and it all works.  I can't imagine having to do anything more
complex with dynamic controls in a server since this one was such a
pain. On the upside I learned many of the finer points of creating
server controls and the next one I write should go a little more
smoothly.&lt;br&gt;
&lt;img src="http://cadred.net/blog/aggbug/260.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/260.aspx</wfw:comment>
        <slash:comments>21</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/260.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/260.aspx</trackback:ping>
    </entry>
    <entry>
        <title>Download Battlestar Galactica ... Legally!</title>
        <link rel="alternate" type="text/html" href="http://cadred.net/blog/archive/2005/03/03/258.aspx" />
        <id>http://cadred.net/blog/archive/2005/03/03/258.aspx</id>
        <published>2005-03-03T23:26:00Z</published>
        <updated>2005-03-03T23:26:00Z</updated>
        <content type="html">&lt;p&gt;It has just come to my attention that you can &lt;a href="http://www.scifi.com/battlestar/"&gt;download and watch&lt;/a&gt; the
first episode of the new &lt;a href="http://www.scifi.com/battlestar/"&gt;Battlestar Galactic series&lt;/a&gt; (hands-down the
best SciFi show on TV in years) for free. The
downside is it's in &lt;a href="http://www.google.com/search?hl=en&amp;amp;lr=&amp;amp;q=realplayer+sucks&amp;amp;btnG=Search"&gt;RealPlayer&lt;/a&gt; format, but you can always use
&lt;a href="http://www.google.com/search?hl=en&amp;amp;lr=&amp;amp;q=realalternative&amp;amp;btnG=Search"&gt;RealAlternative&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
If only you could download Arrested Development for free (no doubt the best Comedy on TV today).&lt;/p&gt;&lt;img src="http://cadred.net/blog/aggbug/258.aspx" width="1" height="1" /&gt;</content>
        <wfw:comment>http://cadred.net/blog/comments/258.aspx</wfw:comment>
        <slash:comments>1</slash:comments>
        <wfw:commentRss>http://cadred.net/blog/comments/commentRss/258.aspx</wfw:commentRss>
        <trackback:ping>http://cadred.net/blog/services/trackbacks/258.aspx</trackback:ping>
    </entry>
</feed>