<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>trevor.conn's blog</title>
  <link rel="alternate" type="text/html" href="http://www.developerdotstar.com/community/blog/trevorconn"/>
  <link rel="self" type="application/atom+xml" href="http://www.developerdotstar.com/community/blog/2/atom/feed"/>
  <id>http://www.developerdotstar.com/community/blog/2/atom/feed</id>
  <updated>2004-12-30T17:20:06-08:00</updated>
  <entry>
    <title>WebForm_ DoPostBackWithOptions not defined</title>
    <link rel="alternate" type="text/html" href="http://www.developerdotstar.com/community/node/641" />
    <id>http://www.developerdotstar.com/community/node/641</id>
    <published>2006-11-10T14:23:36-08:00</published>
    <updated>2006-11-10T14:42:25-08:00</updated>
    <author>
      <name>trevor.conn</name>
    </author>
    <category term="ASP.NET" />
    <summary type="html"><![CDATA[<p>So for the third time in about 6 months I ran into the following message when working on an ASP.NET 2.0 website: "WebForm_ DoPostBackWithOptions not defined". Here is a solution this problem...</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>So for the third time in about 6 months I ran into the following message when working on an ASP.NET 2.0 website.</p>
<blockquote><p>"WebForm_DoPostBackWithOptions not defined"</p></blockquote>
<p>Specifically, I have an ImageButton control that when clicked is supposed to auto-postback and call a server-side function, in this case a "Logout". </p>
<p>I'm in the process of branching code from one deployment revision into a "Work In Progress (WIP)" directory for the next phase. In doing so, I had to set up an IIS virtual directory and copy all the necessary code there. With that done, I noticed that when clicking on the button, the desired logout mechanism was broken in the WIP. Thanks to the Firefox Javascript Console, I saw the message above and was able to track the problem down.</p>
<p>Even more maddening, for the site I'm working on we use the <a href="http://www.componentart.com" target="top">ComponentArt Suite</a> and all of the functionality related to the Grid control stopped working. All the grids would load their items just fine, but would only display a small box where the grid should have been. As I said, this is the third time this has happened to me, and each time I forget what I did to fix the problem. So this is kind of like a bookmark for me. Hopefully it'll be useful to someone else.</p>
<p>I'm using IIS on Windows XP Professional SP2. Bring up IIS and right-click on your virtual directory. Select "Properties". On the Virtual Directory tab in the Application Settings section, click the "Configuration" button. This brings up the "Mappings" tab. Highlight the entry for ".axd" and click "Edit". Be sure that the lower left-hand checkbox for "Check that File Exists" is <i>unchecked!</i> If not, uncheck it and click "OK". The WebResource.axd references you see when doing "View Source" on a .NET webpage don't actually link to a physical file, so if this box is checked then the scripts don't get loaded correctly.</p>
<p>So there you have it.</p>
    ]]></content>
  </entry>
  <entry>
    <title>Organizing .NET Namespaces</title>
    <link rel="alternate" type="text/html" href="http://www.developerdotstar.com/community/node/131" />
    <id>http://www.developerdotstar.com/community/node/131</id>
    <published>2005-02-20T16:30:20-08:00</published>
    <updated>2005-02-20T16:54:20-08:00</updated>
    <author>
      <name>trevor.conn</name>
    </author>
    <category term=".NET" />
    <summary type="html"><![CDATA[<p>A couple months ago I posted the following entry on a discussion forum myself and some friends participate in. A buddy was asking for tips on how to transition this massive VB/COM+ project over to .NET and how he should start thinking about structuring functionality into namespaces assemblies. I'm just going to post it here in case it proves helpful for anyone else. I haven't really revised this post at all, so it may read sort of open-ended. Anyone with questions is welcome to ask.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>A couple months ago I posted the following entry on a discussion forum myself and some friends participate in. A buddy was asking for tips on how to transition this massive VB/COM+ project over to .NET and how he should start thinking about structuring functionality into namespaces assemblies. I'm just going to post it here in case it proves helpful for anyone else. I haven't really revised this post at all, so it may read sort of open-ended. Anyone with questions is welcome to ask.</p>
<p>Note that I have worked my entire IT career in the internet space, so that's the perspective from which this blurb derives. This may not be as relevant to people writing .NET apps for packaged and/or client-server apps.</p>
<blockquote><p>
Well I'll outline the way I've worked with namespaces up to this point. We decided a long time ago at {previous employer name removed} that unless we were going to be building packaged software deployed to millions of end-user machines, the GAC (Global Assembly Cache) is NOT the way to go. Instead, we employed a strategy to keep the AssemblyVersion numbers the same on all our assemblies and instead incrementing the AssemblyFileVersion. You can find both of these settings in the AssemblyInfo.cs of your namespace project. The AssemblyVersion is what other assemblies that reference your namespace will look at. If that number changes, then the referencing assembly blows up. But you as the developer still need to know what version of the assembly is deployed, and for that you use the AssemblyFileVersion attribute. Increment it every time a new version of the assembly is deployed. </p>
<p>The same goes for giving your assemblies a strong name. If you aren't going to put them in the GAC, and you will always be deploying them on in-house machines, then forget about strong naming. </p>
<p>Next, as for deciding what goes into the namespaces, I'm pretty strict where I currently work about designing namespaces such that if a disaster happened and we only had the source code files, we need to be able to recompile from scratch. This means no circular references amongst your namespaces such as: </p>
<p>Namespace A references Namespace B and vice versa </p>
<p>Indirectly, this actually leads to a purer form of OOA/D because you really have to use some interesting indirection to get to your end result...which is what design patterns are all about. You can't always avoid this gotcha, and refactoring namespaces to eliminate circular references can be a real bitch after they're all set up and running. Keep in mind that one assembly can contain multiple namespaces if you simply cannot decouple relationships. Just remember not to put too much functionality into one namespace or else it can become a bottleneck with concurrent projects. </p>
<p>I would recommend starting with the most fundamental part of your whole architecutre -- the data access layer. Chances are everything will need to access it, so start there. Put it in an assembly like CompanyName.Data.dll or some such. It's also handy to think about your namespace tree like ever refining nodes on a functionality tree. </p>
<p>Example (these are all namespaces):<br />
CompanyName<br />
CompanyName.Data<br />
CompanyName.Common<br />
CompanyName.Customer<br />
CompanyName.Web.UI<br />
CompanyName.Web.UI.Public<br />
CompanyName.Web.UI.Private<br />
CompanyName.Web.UI.Admin<br />
CompanyName.Web.UI.Admin.Reports </p>
<p>and so on. The nodes lower in the tree can have visibility to the classes higher up, but the reverse must NEVER happen. You're always working from the general to the specific. </p>
<p>With regard to ASP.NET, every environment I've worked in has done JIT deployment over pre-compiled deployment. There are trade offs to both of course, but JIT seems to allow you to respond to changes quicker without having to deploy alot of unneccesary code. Additionally, all your assemblies will go in the \bin directory of the web server where the runtime will automatically find them when you instantiate objects from your code-behinds. One item in favor of pre-compiled is that, depending on the amount of traffic you're serving from your website, JIT compilation in real-time of code updates might actually crash the webserver if your traffic load is too high. I've seen it happen where I work now. </p>
<p>If you don't already have a copy, you simply MUST buy a copy of <i>Applied .NET Framework Programming</i> by Jeffrey Richter. While it doesn't cover design concepts, it's got more information than you'll ever need about the internals of the .NET Framework and CLR.
</p></blockquote>
    ]]></content>
  </entry>
  <entry>
    <title>Substring Search in an Oracle CLOB</title>
    <link rel="alternate" type="text/html" href="http://www.developerdotstar.com/community/node/68" />
    <id>http://www.developerdotstar.com/community/node/68</id>
    <published>2005-01-11T13:45:27-08:00</published>
    <updated>2005-01-11T14:27:27-08:00</updated>
    <author>
      <name>trevor.conn</name>
    </author>
    <category term="Oracle" />
    <summary type="html"><![CDATA[<p>This entry falls under the "Something New I Learned Today" heading.<br />
I needed to obtain a list of active users who had a particular string within a CLOB field in an auxillary table associated back to their account via a foreign key.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>This entry falls under the "Something New I Learned Today" heading.</p>
<p>I needed to obtain a list of active users who had a particular string within a CLOB field in an auxillary table associated back to their account via a foreign key. You can't do "LIKE" statements against a CLOB, and we don't have Intermedia operational on the boxes where the query needed to run so I couldn't run a "contains" against an index. I say "boxes" because we have two distinct user databases -- one running Oracle 9i and another on 8i. So whatever solution I came up with had to play in both environments. Our DBA mentioned there was a package resident in both called DBMS_LOB which exposed methods for working with LOBs. I saw that one of these was InStr() and hoped that it would allow me to specify the substring I was concerned with, and perhaps return the index where the substring started within the CLOB.</p>
<p>Sometimes there IS reason in the universe. I was able to do this using the following PL/SQL (names have been changed to protect the innocent):</p>
<div class="codeblock">
<pre>select u.user_uid, u.login_text, p.profile_name_text<br />  from profile p, user u<br /> where u.acct_closed_ind = 0<br />   and u.user_uid = p.user_uid<br />   and (<br />dbms_lob.instr(clob_field, &#039;first string to find&#039;,1,1) &gt; 0 or<br />        dbms_lob.instr(clob_field, &#039;second string to find&#039;,1,1) &gt; 0<br />);</pre></div>
<p>Obviously you could stick as many substrings in there as you want using additional ORs. The DBMS_LOB package has all kinds of interesting functions for dealing LOBs. We could have even run a script to update/remove the offending strings automatically. But we opted for safety and will instead have the Customer Support team call the users so they can be educated.</p>
    ]]></content>
  </entry>
  <entry>
    <title>What&#039;s Behind Door #2?</title>
    <link rel="alternate" type="text/html" href="http://www.developerdotstar.com/community/node/55" />
    <id>http://www.developerdotstar.com/community/node/55</id>
    <published>2004-12-30T13:54:06-08:00</published>
    <updated>2004-12-30T17:20:06-08:00</updated>
    <author>
      <name>trevor.conn</name>
    </author>
    <category term="Platforms" />
    <summary type="html"><![CDATA[<p>This is my first blog entry. I don't claim to be an expert in anything, and I reserve the right to be wrong about everything.<br />
I've been an internet developer for almost 9 years now, and most of that time I've spent in a Microsoft environment. Very briefly at the start of my career, I worked for an ISP writing an in-house accounting package to keep up with things like billing, subscribers, hosting, disk usage, etc. Since the user accounts were all on Sun UltraSPARC servers, I did some C programming on Solaris. Other than that, it's been Windows all the way.</p>
    ]]></summary>
    <content type="html"><![CDATA[<p>This is my first blog entry. I don't claim to be an expert in anything, and I reserve the right to be wrong about everything.</p>
<p>I've been an internet developer for almost 9 years now, and most of that time I've spent in a Microsoft environment. Very briefly at the start of my career, I worked for an ISP writing an in-house accounting package to keep up with things like billing, subscribers, hosting, disk usage, etc. Since the user accounts were all on Sun UltraSPARC servers, I did some C programming on Solaris. Other than that, it's been Windows all the way.</p>
<p>Currently, I'm a software architect for an internet E-commerce firm in Atlanta, GA. I've been using Microsoft's .NET platform since it was in Beta 1 and frankly, I love it! Once I got fully into how you could architect systems using full-blown OOA/D, the whole scripting world totally lost its luster. That goes for Visual Basic as well. In .NET I made a conscious choice to use C# because of its more standard syntax. I figured if I wanted to go into an environment that heavily utilized OO development strategies, the folks I'd encounter would've most likely used Java or C++.</p>
<p>So recently I started working on a project in my spare time that hopefully I'll be able to make a little money at someday. When the time came to decide which technology am was going to use, I found myself leaning toward Java despite my clear Microsoft preference. I had previously tried to start a venture with a friend where we were going to use .NET. As a small outfit of two guys, we found an ASP.NET hosting provider for a reasonable price. But the problem came when we had to access the tools and database platform. Of course we could put our hands on copies of SQL Server 2000 and VS.NET 2002, but it wouldn't have necessarily been above board. There's a huge cost to starting up a venture if you want to remain legal in the Microsoft environment. How many of you out there have paid for your home computer's installation of Office2003? Chances are you just used your company's MSDN disk.</p>
<p>I didn't want to go the piracy route, and that made the Java environment very attractive. I downloaded the J2EE environment from java.sun.com and also the latest IDE from NetBeans, and away I went. There are some idiosyncracies to learn in transitioning to this new mindset. Clearly the tools aren't as seemless as Visual Studio, and there's alot more of sticking your fingers in the goo of your environment to make sure everything's integrated. But the tools are getting better about hiding that from the user to maximize productivity. Additionally, I downloaded MySQL which is a free database application that will be perfect for the amount of volume I expect to handle initially. In working with the Java language itself, there's a learning curve in trying to familiarize myself with all the capabilities of the SDK packages, as well as the keywords for implementing interfaces and extending base/abstract classes (makes sense though when you use those keywords in a sentence ;-) ) or overriding methods.</p>
<p>I guess my point is I never thought I'd be taking a peek behind this curtain to see how the other half lives. So far it ain't too bad. I think Microsoft has a real problem in that their tools are prohibitively expensive for someone like me who wants to start his own company without outside investors or alot of cash. I don't have thousands of dollars to license everything I'd need, and I'm not one to steal. Sorry. Free is better at this point. Not only that, in selling what I develop to my target audience of NFP organizations, they're not going to want to pay Microsoft licensing fees either to provide my application an environment. And once I've got my platform functioning, I'm probably going to be loathe to switch to Microsoft, even though I think .NET is great. We'll see.</p>
    ]]></content>
  </entry>
</feed>
