<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5825501</id><updated>2011-04-21T22:03:48.794-07:00</updated><title type='text'>.Net Development</title><subtitle type='html'>Thoughts on .Net, code, etc.  Sorry no comments right now.  &lt;a href="http://www.jeffreypalermo.com"&gt;My Blog&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jpalermo.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5825501.post-112137083880901539</id><published>2005-07-14T12:53:00.000-07:00</published><updated>2005-07-14T12:53:58.810-07:00</updated><title type='text'>My blog has moved again.</title><content type='html'>Check out my new blog: &lt;a href="http://www.jeffreypalermo.com/"&gt;http://www.jeffreypalermo.com/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-112137083880901539?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/112137083880901539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/112137083880901539'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2005_07_01_archive.html#112137083880901539' title='My blog has moved again.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108217142355905844</id><published>2004-04-16T20:10:00.000-07:00</published><updated>2004-04-16T20:13:17.200-07:00</updated><title type='text'>Blog has moved</title><content type='html'>My blog has moved to &lt;a href="http://dotnetjunkies.com/WebLog/jpalermo"&gt;http://dotnetjunkies.com/WebLog/jpalermo&lt;/a&gt;.  The new site has comments and an RSS feed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108217142355905844?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108217142355905844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108217142355905844'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108217142355905844' title='Blog has moved'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108199654185411884</id><published>2004-04-14T19:35:00.000-07:00</published><updated>2004-04-14T19:39:17.200-07:00</updated><title type='text'>Great XML DataBinding post</title><content type='html'>Check out &lt;a href="http://msmvps.com/coad/posts/4990.aspx"&gt;this post&lt;/a&gt; on xml databinding in IE.  If your Intranet web app will be run with IE 5+, this is a great way to quickly display data.  The xml file can be generated dynamically, so it works well. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108199654185411884?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199654185411884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199654185411884'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108199654185411884' title='Great XML DataBinding post'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108199632302309031</id><published>2004-04-14T19:32:00.000-07:00</published><updated>2004-04-14T19:34:54.450-07:00</updated><title type='text'>Usage of proper grammar in blog posts</title><content type='html'>I just went back and read one of yesterday's posts, and I caught some grammar errors, typos, etc.  As my time is limited when writing these posts, I usually don't go back through and revise/edit the posts.  While I try to write as properly as I can, all my posts will be first drafts.  When I write an actual technical article, I will revise the article and correct any errors that my present themselves before publishing it. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108199632302309031?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199632302309031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199632302309031'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108199632302309031' title='Usage of proper grammar in blog posts'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108199630668090829</id><published>2004-04-14T19:31:00.000-07:00</published><updated>2004-04-14T19:34:38.106-07:00</updated><title type='text'>Web Matrix ClassBrowser vs. WinCV</title><content type='html'>One of the VS.Net tools is WinCV.  I'm sure it's short for Class Viewer.  Juval Lowy, in his episode of MSDN TV, introduces WinCV as one of his tips and tricks.  In my opinion, everyone who is doing ASP.NET development should have an installation of Web Matrix.  Included in that 1.3MB download is a lightweight ASP.NET development tool sans intellisense or code-behind.  More importantly, it comes with a program call Matrix ClassBrowser.  In my opinion, this tool does a much better job of type discovery than WinCV.  WinCV just displays a class outline.  ClassBrowser will also do this, but it has several more powerful features.  For instance, in ClassBrowser, if you aren't sure what you are searching for, you can browse by namespace.  The feature I use most is the search feature.  I can search for a class.  Then I can pick from the search results.  Once the type is displayed, then the powerful features come into play. I can switch between class outline and description.  I prefer the description view where it displays its inheritance hierarchy, and then there are two useful option:  Search for types extending the type, and search for types that have this type as a field, property, or method.&lt;br /&gt;&lt;br /&gt;Yesterday I posted about the collections built into the .Net Framework.  I knew that there were collection based on IList and some bases on IDictionary.  In ClassBrowser, I looked up IDictionary, and then searched for types extending IDictionary.  I can not do this in WinCV.  Searching for types extending this interface quickly returned the information I needed, and this type of search is not even possible in the SDK documentation.  I think this is very powerful.  Furthermore, ClassBrowser will allow you to view a class definition including members that are inherited from a base class.  WinCV only shows the current class outline without inherited members.  ClassBrowser can also show you private members if you desire to see them.  Two other features I use often are 1:  A link to the online MSDN documentation for this type, and 2:  A link to the SDK documentation for the type.  All in all, it's a great tool, and I use it almost every day.  The only shortfall of the tool is that it is based on v1 of the .Net Framework, so some types have changed, but most types are close enough that it doesn't make any difference.  The link to the SDK documentation for the current type does go to the v1 SDK that I have installed, so to jump over to the SDKv1.1 of the docs, I just have to type in "v1.1" after the "SDK" in the url.  I would very much like to see a version of this tool that can search over v1.1 of the Framework and even v2 when it comes out.  It's a little puzzling because through a "customize" option, I can load in my own custom library assemblies, and ClassBrowser will look in those during a search as well, and I can explore my own types just as powerfully as .Net Framework types.  Of course, the link to the SDK docs for my types is broken. :-)&lt;br /&gt;&lt;br /&gt;In conclusion, I highly recommend the Web Matrix ClassBrowser for type discovery and research.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108199630668090829?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199630668090829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108199630668090829'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108199630668090829' title='Web Matrix ClassBrowser vs. WinCV'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108192280020488983</id><published>2004-04-13T23:06:00.000-07:00</published><updated>2004-04-13T23:09:32.873-07:00</updated><title type='text'>Lost post (I wrote offline back in March when i had no connectivity at all)</title><content type='html'>12 March 2004&lt;br /&gt;I'm still here in Iraq serving with the Army Reserve.  I've been here almost a year, and I go home in a month.  Today I spent all afternoon downloading the Longhorn preview from MSDN, and now that I have it, I'm installing it in a Virtual PC on this computer.  Virtual PC is a great product.  Great job, Microsoft!  So Longhorn is projecting a 15 minute installation.  That's way better that all previous versions of Windows although win 3.1 and win95a has floppy disks which slowed the installation down as well.&lt;br /&gt;&lt;br /&gt;To be honest, it's kind of exciting to see the install GUI of the next windows.  Now when I install Longhorn for real after it comes out, I'll have seen it before and know what to expect.  The best thing I ever did was buy that extra 512mb of RAM for my Dell Lattitude laptop.  With 768MB of RAM, I can run XP Pro as the host as well as a fully functional Virtual install, so I should be able to fully test out this Longhorn preview.  To anyone with 256MB of RAM doing any kind of software development, I highly recommend 512MB MINIMUM, but you already know that.&lt;br /&gt;&lt;br /&gt;So here is how it is.  I download the .iso file from MSDN, and all I do it set it as the Virtual PC CD drive, Virtual PC mounts the file, and it boots straight into the install.  How cool is that?  Longhorn setup then asks for the CD key and then goes to a settings page where you can set the computer name and where on the hard disk(s) you want Longhorn installed.  It also shows some other default settings. After that, it goes to a screen for "Collection information and copying files needed for setup"  This page takes most of the setup time. &lt;add more here about how setup progresses&gt;&lt;br /&gt;&lt;br /&gt;I've read all the hype about Longhorn, Avalon, Indigo, WinFS, etc, and it all sounds pretty cool.  From a  development standpoint, the thing I am most excited about is XAML.  VB6 and even WinForms requires controls to be placed on the form using grid coordinates.  for web developers, the hardest thing to do is make a webform with absolute positioning.  Now don't get me wrong.  For simple input forms, you probably don't need to make the UI that flexible in its placement of controls, but for applications that display more dynamic text or content, absolute placement of controls can be a stumbling block.  Web programmers have always been able to benefit from the flow layout of HTML.  In my Web Forms, even though I have a choice of GridLayout or FlowLayout, I always choose FlowLayout because it's more flexible.  Anyway, back to XAML.  This markup language will replace coorinate placement of controls in Longhorn winforms.  Now you can more easily have dynamic content in your windows apps.  Personally, I prefer web apps to win apps.  Every business app is going to be a distributed app.  Even if it's as simple as editing customer data or entering an order.  Even if it's a VB6 front end, it will have to communicate with a server either running some COM components or *gasp* interacting directly with the database.  Well I would put that app on a webserver in a heartbeat.  You can make an interface that is so much more flexible AND now that society is used to the Internet and web pages, why force your user to learn your UI. . . just make it a web application, and they are already familiar with how a web UI works.  You have buttons and links, textboxes and drop down lists.  Now XAML will give you the flexibility of a web form with the ability to have complete control as the developer did with winforms (since XAML is the future of winforms).&lt;br /&gt;&lt;br /&gt;Now I've heard the argument that Windows developers are worried that Microsoft is going to force them to recycle their skills as web developers, but that's just not true.  Honestly, how many of you windows developers actually typed in the coordinates of where to place your controls on the forms?  I didn't think so.  You dragged them onto the form, and then you added code to make the parts of the form functional.  Well if you don't want to deal with XAML, then don't.  Just continue to drag and drop your controls and then add your code behind them.  I'll take a step further and adjust the XAML so that parts of my form can grow and shrink with dynamic content.  I am very excited about XAML, but remember, it's still years away.  Heck, we can't even write a .NET Windows app right now unless we have a corporate environment where we can guarantee that all the clients will have the .NET Framework installed.  So will be the same with XAML.  I'm hoping that Microsoft will build XAML into a service pack for XP or perhaps a Framework upgrade because I don't see Longhorn proliferating as soon as 2007.  I think XP is such a great operating system that a lot of companies won't be able to justify upgrading so soon.  Win98 to XP was a no-brainer, but now that knowledge workers DON'T have to reboot several time a day (perhaps once a week or less), XP is meeting the need of a lot of people.  So here's to Microsoft making an upgrade for XP that will allow XAML apps!&lt;br /&gt;&lt;br /&gt;I look forward to Longhorn and XAML.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108192280020488983?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108192280020488983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108192280020488983'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108192280020488983' title='Lost post (I wrote offline back in March when i had no connectivity at all)'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108191834100518634</id><published>2004-04-13T21:52:00.000-07:00</published><updated>2004-04-13T21:57:31.090-07:00</updated><title type='text'>I'm tired of making strongly-typed collections</title><content type='html'>I use stongly-typed collections all the time for items that are going to be reused quite often.  I have recently gone on an adventure to educate myself of what collection are available in the .Net Framework and how they differ.  My current scenario had a need for a collection to store a pair of strings and retain the order with which I added them to the collection, and I need to be able to bind the collection directly to a list control.  A dataset would be an overkill.  Right away, I know I'm going to be dealing with a key-value pair.  This automatically rules out all the collections based on the IList interface:  ArrayList, StringCollection.  Since I need a key-value pair, I need a collection based on IDictionary:  Hashtable, HybridDictionary, ListDictionary, and SortedList.  Not too many to choose from, but I refuse to extend CollectionBase for this tiny task that is isolated to one user control!&lt;br /&gt;&lt;br /&gt;I began to explore the differences between these four collections that are all bases on IDictionary and all stored the key-value pair in a DictionaryEntry object.  What is really important is the underlying data structure of the collection.  &lt;br /&gt;&lt;br /&gt;The Hashtable is meant to offer better-than-linear performance on lookups.  The order of the items is not guaranteed, and, in fact, you can add some items, then immediately iterate through to print them out, and they will often be in a completely different order.  Ok, Hashtable is disqualified.&lt;br /&gt;&lt;br /&gt;They HybridDictionary works well for my purposes. . . only if the number of items is no greater than 10.  This is because it's "Hybrid".  With 10 items or fewer it implements a ListDictionary under the hood (see next section).  As soon as you add the 11th entry, it switches to a Hashtable, and all ordering reliability goes out the window.&lt;br /&gt;&lt;br /&gt;The ListDictionary meets the requirements.  It stores a key-value pair, and it retains the order in which I add the items.  It does this by implementing the linked list data structure internally.  According to the SDK, the ListDictionary has better performance than a Hashtable up to 10 items, and then Hashtable becomes faster.  The SDK also warns that the ListDictionary should not be used with many items where performance is an issue.&lt;br /&gt;&lt;br /&gt;I also looked at the SortedList just to make my comparison complete.  The SortedList behaves like a Hashtable in that you can use a key to look up the value, but you can also use the index to find the value.  Internally it keeps two arrays sychronized:  one array for the keys and one for the values.  It sorts the entries when added, so the list is always sorted, hence the name.&lt;br /&gt;&lt;br /&gt;When whidbey gets here, I won't have to worry about strongly-typed collections anymore.  I'll be able to declare them generically. . . or is that specifically? :-)  I can't wait!  &lt;br /&gt;&lt;br /&gt;I love the SDK.  Especially since I don't have access to Google and my other online resources, I have used the SDK documentation so much!  It is a wealth of knowledge that every .Net developer should reference.&lt;br /&gt;&lt;br /&gt;To get back to the collections, I did look at the NameValueCollection, but it does not implement IDictionary.  Also, I was not able to bind it to the list control in the way I wanted.  If I juse specified the source and then hit the “DataBind()” key [:-)], it would bind the list with the key value for the text as well as value.  But I need to set the DataTextField and DataValueField.  With IDictionary-based collections, "Key" and "Value" work, but the NameValueCollection returns a single string, not a DictionaryEntry object, so this presents a problem in getting the value in a binding situation.  Sure, I could iterate through it and get the keys and values, but I'm just databinding, so I had to rule out this collection.&lt;br /&gt;&lt;br /&gt;Finally, I chose the ListDictionary for my purposes.  Then I started thinking that is some cases, my key-value set could become large, so I can't use the ListDictionary.  I might have to write one more strongly-typed collection.  But for now, I'll use an ArrayList of DictionaryEntry objects.  How's that for thinking outside the box?  The ArrayList will grow dynamically and keep my items in a specific order because of the IList interface, but I can bind the key and value because the object being stored is a DictionaryEntry object.  I think I'll call it DictionaryList.  So one more time, I have to extend CollectionBase (it's internal data structure is an ArrayList).  Normally I could extend the DictionaryBase class, but internally it uses a Hashtable which doesn't guarantee order.  And I'm back to strongly-typed collections. . . but this one I'll reuse over and over and over and over.  &lt;br /&gt;&lt;br /&gt;public class DictionaryList : CollectionBase  &lt;br /&gt;{&lt;br /&gt; public DictionaryEntry this[int index]  &lt;br /&gt; {&lt;br /&gt;  get{ return((DictionaryEntry)List[index]);}&lt;br /&gt;  set{ List[index] = value;}&lt;br /&gt; }&lt;br /&gt; public int Add(object key, object value)&lt;br /&gt; {&lt;br /&gt;  DictionaryEntry entry = new DictionaryEntry(key, value);&lt;br /&gt;  return List.Add(entry);&lt;br /&gt; }&lt;br /&gt; //rest of class truncated.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Ahh, the answer to so many of my problems! Now it's so simple to pop a few items in and then bind to a list control:&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;list.DataSource = myDictionaryList;&lt;br /&gt;list.DataTextField = "Key";&lt;br /&gt;list.DataValueField = "Value";&lt;br /&gt;list.DataBind( );&lt;br /&gt;list.SelectedValue = myValue;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108191834100518634?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108191834100518634'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108191834100518634'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108191834100518634' title='I&apos;m tired of making strongly-typed collections'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108191831556628320</id><published>2004-04-13T21:51:00.000-07:00</published><updated>2004-04-13T21:54:45.670-07:00</updated><title type='text'>Possible bug in ASP.NET 1.1?</title><content type='html'>I'll preface this post by saying that I don't have constant connectivity to the Internet from where I am right now.  Every morning I wake up at 4:45AM, walk 1/2 of a mile to a satellite Internet Cafe run by some Arabs, and pay $6/hour to hook my laptop up to the Internet.  Imagine 1 hour of Internet per day, and you can calculate that monthly bill and compare it to your cable modem bill.  I use Net2Phone and for $.02 per minute, I can talk to my wife over the Net.  &lt;br /&gt;&lt;br /&gt;The point of that preface is that it's hard to do some immediate Internet research into this issues, but here it is:&lt;br /&gt;&lt;br /&gt;I have a page that has a user control containing a form.  The form uses some of the validation controls with client script enabled.  Everything works great.  The form got a little long, and sometimes the length of one of the grids causes the page to scroll, and the save button is at the button.  I turn on SmartNavigation to remedy the post-back-lose-scroll-position problem, but now, instead of posting back, some of the buttons will erroneously trigger the client validation script to fail even though input values are valid.  I turn off SmartNavigation, and everything is perfect.  Very frustrating.  I'm wondering if the two features have a javascript conflict because I also get a javascript error when this occurs.  I'm wondering if anyone else in the ASP.NET community has experienced this and if there is a workaround.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108191831556628320?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108191831556628320'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108191831556628320'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108191831556628320' title='Possible bug in ASP.NET 1.1?'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108182671609341467</id><published>2004-04-12T20:25:00.000-07:00</published><updated>2004-04-12T20:28:05.513-07:00</updated><title type='text'>My friend Noah has a blog - MVP C#</title><content type='html'>My friend &lt;a href="http://www.msmvps.com/coad/"&gt;Noah Coad&lt;/a&gt; has just started his blog, so look for good content.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108182671609341467?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182671609341467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182671609341467'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108182671609341467' title='My friend Noah has a blog - MVP C#'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108182341372915338</id><published>2004-04-12T19:30:00.000-07:00</published><updated>2004-04-12T19:33:03.043-07:00</updated><title type='text'>Making a page's base class an abstract class.</title><content type='html'>In the normal code-behind technique, your page inherits from this regular class you create as the code-behind class.  I'm implementing a template feature in my project, and most templates will be just markup without code, so there is no need for a code-behind class; however, I wanted to make sure every template implemented two properties, so I thought, “I'll use an abstract class”.  I created an abstract class and inherited my pages from it.  It worked great, but I had a problem with the VS.NET designer.  I can view the Template page in the designer because “the designer can't create an instance of an abstract class”.  Then I thought, “what benefit am I getting by making this base class abstract?  Not much.  If I make it a regular class, I can implement virtual, default values.  So that's what I did.&lt;br /&gt;&lt;br /&gt;Lesson learned:  Code-behind classes need to be non-abstract so the designer can function properly.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108182341372915338?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182341372915338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182341372915338'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108182341372915338' title='Making a page&apos;s base class an abstract class.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108182339675006242</id><published>2004-04-12T19:29:00.001-07:00</published><updated>2004-04-12T19:32:46.076-07:00</updated><title type='text'>Post-back mania</title><content type='html'>We have a new, great post-back model with ASP.NET.  In fact, I was using a similar model in ASP 3.  I would choose a course of action based on a querystring or form value.  I would post information back to the same page with an “action” querystring that described what to do next.  The model worked well then.  Now we have that model implemented for us.  With any new capability comes the question: “When should I use it?”  Certainly not all the time.  I can pass XML to SQL Server, but does that mean that I should do it for every single stored procedure now?  Certainly not!  &lt;br /&gt;&lt;br /&gt;I am currently working on a page that modifies certain properties.  To save the data, I have a button that posts back, and I save the information.  I have a cancel button.  Should I use a postback with the cancel button?  When the user cancels, I just want to leave this page and discard any changed information.  I really don't have any clean-up processing for this instance.  I could post back and do a Response.Write( ) or Server.Transfer( ), but do I really need to reload that whole form, and then execute the button event handler to leave the page?  That would be extra, unnecessary processing.  No, instead, I'll just have the button do a javascript onclick event that modifies the “location.href”.  No unnecessary post-back.  More efficient.  &lt;br /&gt;&lt;br /&gt;There have been several times where a simple hyperlink was much better suited for a task than a post-back.  Also, remember that post-back handling comes after the Init and the Load events.  So on a post-back, you reload all the old data before the post-back handling occurs.  In some cases, I pass a querystring value to a page so that it knows what it needs to do right from the start.  I can start doing work in the Init so that my usercontrols have the information they need in thier Load events.  &lt;br /&gt;&lt;br /&gt;As with all new capabilities comes the design decision of when to use them.  With the up-coming Yukon release of SQL Server, I see some people putting all their business logic with the database's CLR.  Again, we will have to really analyze when it is appropriate to write some managed code at the database.  Certainly not all the time.  &lt;br /&gt;&lt;br /&gt;Even when new capabilities surface, remember tried-and-true methods that have worked for years.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108182339675006242?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182339675006242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182339675006242'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108182339675006242' title='Post-back mania'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108182337382417866</id><published>2004-04-12T19:29:00.000-07:00</published><updated>2004-04-12T19:32:23.153-07:00</updated><title type='text'>Outsourcing IT Jobs and the Development job market.</title><content type='html'>I'm listening to Bob Reselman on .Net Rocks right now, and some very interesting points were brought up.  First is the outsourcing of IT jobs to India and other places where developers will work for fewer dollars.  The company for which I work has partially done that, and half of my development team is actually in India.  The guys over there do excellent .Net work, and they are very intelligent.  We tasked them to write a module, and the result of fabulous and met the specs exactly.  The problem with outsourcing to a foreign country is that the customers are still here in the U.S.  There has to be someone to translate from the customer's need to the technical specs and then actually code to those specs with the customer's needs in mind.  The developers in India just can't do that.  They can do pieces that we delegate and monitor, but in order to produce a quality product, American developers are still needed to pull it all together and make a package that is geared to the customer.  I imagine that some IT departments think only with their wallets, but then they fail to estimate the added cost of communication.  Outsourcing development creates a huge communication barrier, and that will cost money.  There will need to be more code and feature reviews to ensure the project is on track.  The communication barrier is very real and very expensive, so I predict that some companies that are quick to outsource to India will come back and learn that they need hometown developers as well, and they will lose money for jumping on this bandwagon instead of save money.&lt;br /&gt;&lt;br /&gt;I know that plenty of software developers are out of work now or are working for less money than they feel they deserve.  I know it's tough in parts of the country.  More now than ever, we must all take responsibility for our careers and for providing for our families.  Yes, it's a greater challenge now, but the laws of supply and demand are working.  We must improve our skills so that we are more in demand.  In this market, a developer cannot coast and hope to find a nice, tidy, well-paying job.  There is more competition.  Competition is good.  That is what our economy is based on.  I've been away from my development job for over a year while deployed to Iraq, and I have some catching up to do if I am to stay competitive.  I'm going to have to put the nose to the grindstone because there are people out there eyeing my job.  It's up to me. . . and you.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108182337382417866?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182337382417866'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108182337382417866'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108182337382417866' title='Outsourcing IT Jobs and the Development job market.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173989001842808</id><published>2004-04-11T20:18:00.000-07:00</published><updated>2004-04-11T20:45:05.140-07:00</updated><title type='text'>Finished uploading posts</title><content type='html'>I had made some blog posts locally on my local .Text installation, but over here in the middle east, I don't have the time on the .Net to set up a proper blog (a task for when I get home to Texas), so I just signed up for this free Blogger tool.  Jon Box convinced me to set up a public blog (didn't take too much to convince me), so now I have a public blog.  When I get home, I'll quickly move this to a better place, but here you go Jon.  I now have a blog!  Only an Atom feed for now.  When I move it over, I'll be sure to have an RSS feed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173989001842808?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173989001842808'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173989001842808'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173989001842808' title='Finished uploading posts'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173924290443455</id><published>2004-04-11T20:07:00.000-07:00</published><updated>2004-04-11T20:10:11.560-07:00</updated><title type='text'>MVP Global Summit and my friend, Noah Coad</title><content type='html'>A week ago, I emailed Noah Coad (Texas A&amp;M student and C# MVP), and I inquired if he was attending the MVP Conference.  He emailed me back from the Summit, and he had included notes from several other MVPs that he met at the conference.  I'm compelled to include the E-mail here:&lt;br /&gt;&lt;br /&gt;From Noah Coad:&lt;br /&gt;&lt;br /&gt;Hey Jeff!  As always, it's great to hear from you!  Yes, in fact, I'm here&lt;br /&gt;in the hotel up in Seattle right in the middle of the MVP Global Summit!&lt;br /&gt;&lt;br /&gt;You'd never guess who I'm sitting here hanging out with late in the hotel&lt;br /&gt;lobby...  They all wanted to say hi!  We all appreciate your dedication&lt;br /&gt;there in Iraq.  Check below...   I'll post my reply to your message below.&lt;br /&gt;:)&lt;br /&gt;-------------&lt;br /&gt;&lt;br /&gt;Hey Jeff,&lt;br /&gt;&lt;br /&gt;Mark Dunn here.  Noah tells me you are a big fan.  Glad u enjoy the .Net&lt;br /&gt;Rocks shows.  Just wanted to say hello and wish you well.  Drop me a line&lt;br /&gt;sometime.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;&lt;br /&gt;-Mark&lt;br /&gt;&lt;br /&gt;----------&lt;br /&gt;Jeff,&lt;br /&gt;&lt;br /&gt;You may not know Keith Nicholson, but I'm a big fan of yours.  Thanks for&lt;br /&gt;serving our country.  It's good to know you have a great friend like Noah&lt;br /&gt;keeping up with you.  I hope you get a lot of time programming.  Hope to see&lt;br /&gt;you at a MVP program in the future.  If you or any other developers want to&lt;br /&gt;chat, feel free to contact me.  &lt;br /&gt;&lt;br /&gt;Peace,&lt;br /&gt;Keith Nicholson&lt;br /&gt;&lt;br /&gt;----------&lt;br /&gt;&lt;br /&gt;Hey Jeff,&lt;br /&gt;&lt;br /&gt;You know you're now famous with the MVP crowd. Who knew one email would&lt;br /&gt;vault you into stardom! Although I'm a Canadian I want to say thanks for&lt;br /&gt;what you're doing over in Iraq. Keep safe and keep up with your development&lt;br /&gt;skills... .NET Rocks!&lt;br /&gt;&lt;br /&gt;Rob Windsor [MVP-VB]&lt;br /&gt;Toronto Visual Basic User Group&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;&lt;br /&gt;Hey, Jeff -&lt;br /&gt;&lt;br /&gt;I came downstairs to grab a glass of water, and then I got caught up in a&lt;br /&gt;conversation with a few geeks when one of them spoke up and said that he&lt;br /&gt;knew you.&lt;br /&gt;&lt;br /&gt;So, I'm Rory (.NET Rocks), and just wanted to say that Carl and I have&lt;br /&gt;really enjoyed your letters. It blows us away that you're off on the other&lt;br /&gt;side of the planet and listening to the show. You're a true fan, and we&lt;br /&gt;honestly appreciate it :)&lt;br /&gt;&lt;br /&gt;Write to us whenever you feel like. We seriously enjoy hearing from you.&lt;br /&gt;&lt;br /&gt;Talk to you later,&lt;br /&gt;&lt;br /&gt;- Rory&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Jeff:  &lt;br /&gt;&lt;br /&gt;Jon Box here. Thanks for protecting our country and keep sending those&lt;br /&gt;updates to .NET Rocks.  I think you should send a picture to those guys and&lt;br /&gt;start a blog.  It would get a bunch of hits.  Anyway, stay safe and hurry&lt;br /&gt;home.&lt;br /&gt;&lt;br /&gt;Jon Box&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hello Jeff,&lt;br /&gt;&lt;br /&gt;Hi from another MVP here at the summit in Seattle.  Stay safe.&lt;br /&gt;&lt;br /&gt;David Totzke&lt;br /&gt;Chair, Marketing and Sponsorship &lt;br /&gt;International .NET Association&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Wow.  I've heard a lot of these names from .Net Rocks and from reading blogs, so I'm eager to get back to the states and maybe meet some of you who replied at a development conference.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173924290443455?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173924290443455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173924290443455'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173924290443455' title='MVP Global Summit and my friend, Noah Coad'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173920626147891</id><published>2004-04-11T20:06:00.000-07:00</published><updated>2004-04-11T20:09:34.920-07:00</updated><title type='text'>.Text as a blog tool.</title><content type='html'>Kudos to Scott W. for an excellent weblog tool.  I installed the 0.95 release on my laptop and configured it for a single blog.  Even though I don't have a persistent Internet connection here in Kuwait (waiting to come home), I'm making posts locally.  When I get home, I'll publicly post them.  This week, I'll get on the Net for about 2 hours every morning.  One hour, I'll be talking to my wife through Net2Phone, and the other hour, I'll be synchronizing SharpReader, E-mail, catching up on Dilbert, etc.&lt;br /&gt;&lt;br /&gt;Scott, great job.  I know it must be tough finding time to work on this project given that we developers have other work that has to get done in order to pay the bills.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173920626147891?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173920626147891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173920626147891'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173920626147891' title='.Text as a blog tool.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173911461495340</id><published>2004-04-11T20:05:00.000-07:00</published><updated>2004-04-11T20:09:13.653-07:00</updated><title type='text'>Code-behind obsolete in Whidbey?</title><content type='html'>I almost started this post with “So, “, but I stopped myself.  Listening to .Net Rocks, and reading other blogs, I'm beginning to lose some basic grammar ability.  “So” does not belong at the beginning of a sentence (unless it's used to mean “so that“ and preceeds a subordinate clause).  It either separates two independent clauses or an independent clause and subordinate clause when meaning “so that”.  Ok, on with my post.&lt;br /&gt;&lt;br /&gt;.Net 1.0 comes out, and everyone jumps on the bandwagon of code-behind (myself included).  Not only is it a good idea to separate code from presentation, MS recommended it, so we did it.  I don't regret it.  One thing to note:  code attached to a page should only do small things e.g. bind a listbox to a source, change text of a label or TextBox, show/hide controls, input validation etc.  Things that should not be done in page code are connecting to a database, reading/writing to/from a file, executing business logic or validation, etc.  If the Html view of the VS.NET designer had included intellisense for code, there would have been people who never would have used code-behind, but because that was the only option that offered intellisense, that's what we did.  Choosing code in a server-side script tag or inheriting your page from a code-behing class should be developer or team preference.  If you are properly separating business logic from the UI, this shouldn't be an issue, but so many developers continue to omit business logic classes from thier applications.  They connect directly from the web server to the database.  They tightly couple their UI with business logic.  Then, when changes need to be made, it takes longer than necessary and code reuse consists of copy and paste.  Bad idea.  Plus, why should an Internet-facing web server have direct access to an internal database server?  That, too, is a bad idea.  &lt;br /&gt;&lt;br /&gt;Let me share with you some successes I've had with code-behind.  Note that code-behind is just the term used for creating an intermediate class betwixt the actual page and the System.Web.UI.Page class from which they all inherit.  With code-behind, you are subclassing the Page class, adding properties and methods, and then inheriting your actual page from your class.  Now your page class has access to all your public or protected members.  I quickly found that in a web app, many pages are going to have some of the same properties.  A user object is a good example of something that every page is going to need.  Why declare that property in every code-behind class?  Instead I created my own MyPage class that inherits from System.Web.UI.Page.  In this MyPage class, I declare the User property (with the “new” keyword to hide the base class's User Property - my User object implements IPrincipal) and other properties and methods that need to be available throughout the application.  I add code in the MyPage class to initialize the User object and do other things, and then every code-behind class inherits from MyPage.  Now every page in my application benefits from this abstraction because every page can use my own User object natively.  I wrote the logic once, and I can use it on every page.  Now that is what object-oriented development is all about!  True code reuse.  I remember the days of #include in ASP 3.  .Net is so much better.&lt;br /&gt;&lt;br /&gt;To get back to the change in Whidbey, I say, welcome inline intellisense.  Since my pages have little code anyway, I will probably go back to putting code in the same file.  This still won't be the same situation as ASP 3.0, however, for the code will be in a &amp;lt;script runat=server&amp;gt; tag, and won't be inline with the Html.  Also, because ASP.NET is compiled, this code will not be in the source files that are deployed on the server, so my pages will have some UI code and method calls to business objects.  That's about it.  &lt;br /&gt;&lt;br /&gt;All in all, I tend to trust Microsoft to make good decisions about the development tools.  There are tons of developers working to come up with these coding methods, and I'm pretty sure that I don't know better than the collective knowledge of the Microsoft developers.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173911461495340?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173911461495340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173911461495340'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173911461495340' title='Code-behind obsolete in Whidbey?'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173908914750010</id><published>2004-04-11T20:04:00.002-07:00</published><updated>2004-04-11T20:07:37.840-07:00</updated><title type='text'>Events (Multicast delegates), Cache, and Garbage Collection</title><content type='html'>One issue that has perplexed me since having a nasty bug associated with a static event declared in a cached object is:  If you cache an object, how can your ASP.NET pages that subscribe to its events be garbage collected when that cached object has a delegate with references to event handling methods in the page object?&lt;br /&gt;&lt;br /&gt;Some background on my issue:  I had declared a static Login event in a User object so I could be notified globally when a user logged in.  Every page subscribed to this static event.  Of course we know that only one static event exists for the app domain even though many objects of that type may exists.  So we have one static multicast delegate containing references to event-handling methods in every single page object in my web app.  Well, from examing the perf counters, memory keeping being consumed but never freed.  Why isn't the garbage collector freeing these page objects?  Allocation Profiler reveals a whole bunch of Page objects in the Heap.  It turns out that as long as this static delegate has a reference to a method in the page object, that page object is not available for garbage collection.&lt;br /&gt;&lt;br /&gt;Why, then, doesn't ASP.NET exibit the same behavior when you have an instance event in an object that is cached and lives for the life of the appdomain?  This same object retains references to the event-handling methods in the pages, but the garbage collector reclaims their memory.  Why this difference in behavior?  I keep searching.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173908914750010?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173908914750010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173908914750010'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173908914750010' title='Events (Multicast delegates), Cache, and Garbage Collection'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173906391143412</id><published>2004-04-11T20:04:00.001-07:00</published><updated>2004-04-11T20:07:12.606-07:00</updated><title type='text'>Waiting to fly back home.</title><content type='html'>We're in Kuwait now.  Back from Iraq and waiting to fly home.  We're supposed to be home in a week.  Because of the recent militia attacks in Falluja and a few other places, some troops are being extended another 4 months.  So far we haven't been one of them, and I have prayed over and over again that God would get me home in a week as planned.  It's enough reason to be nervous.  I've been away from my wife for over a year, and to imagine another 4 months is not pleasant.  &lt;br /&gt;&lt;br /&gt;Today we celebrated the resurrection of our Savior, Jesus Christ, out here in the desert on this Easter Sunday.  All our petty problems pale in comparison to the sacrifice that Christ made for us when he allowed himself to be sacrificed for the payment of our sins, and then what joy to know that he triumphed over death and rose from the grave and is in heaven right now sitting next to God the Father.  Praise the Lord.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173906391143412?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173906391143412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173906391143412'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173906391143412' title='Waiting to fly back home.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173904434669263</id><published>2004-04-11T20:04:00.000-07:00</published><updated>2004-04-11T20:06:53.060-07:00</updated><title type='text'>Development laptop</title><content type='html'>Last September I purchased a Dell Lattitude D500 laptop from a Dell store in Kuwait.  Dell is only direct in the U.S., but in Kuwait and Iraq, most goods are sold face-to-face.  I paid KD345 or roughly $1550.00.  It has a 1.3 Ghz Pentium M and 256MB of RAM.  I've added a 512MB chip, so now it has 768MB of ram now.   30GB hard drive.  Centrino.  &lt;br /&gt;&lt;br /&gt;I am very satisfied with this laptop for a development platform.  I run XP Pro, VS.NET 2002, 2003, IIS, SQL Server 2000, Web Matrix, VSS, WinAmp, etc.  I've turned off the paging file to minimize hard disk usage, and it's turned out well.  I've never used up all available RAM even with all my .Net programs running - ok, once when I used a static event with my ASP.NET pages, so every page retained a reference from the event and prevented garbage collection altogether. :-)&lt;br /&gt;&lt;br /&gt;This laptop is not slow by any means, and I get at least 2 hours on the battery with full screen brightness and everything running.  4 hours if I'm not in VS.NET.  I highly recommend it.  It has even done well in this very dusty part of the world.  I periodically used canned air to blow it out.  It's a must.  The laptop runs very cool with most of the heat coming from the hard disk and RAM bays.  The cooling fan rarely has to kick in, so I guess Intel got the cooling right with the Pentium M.&lt;br /&gt;&lt;br /&gt;Some bloggers have lamented over developing on a laptop or tablet, but I intend to use this laptop with a docking station when I get back home.  It more than meets my performance needs.  &lt;br /&gt;&lt;br /&gt;I highly recommend the Dell Lattitude D500 as a .Net development platform.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173904434669263?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173904434669263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173904434669263'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173904434669263' title='Development laptop'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173902418411515</id><published>2004-04-11T20:03:00.000-07:00</published><updated>2004-04-11T20:06:32.890-07:00</updated><title type='text'>A soldiers opinion on Iraq.</title><content type='html'>There are a lot of political arguments about Iraq: what's going on, how good/bad it is, whether we should be there.  Having spent a year there are seeing a lot of the country and its citizens, I can firmly say that we have not only gotten rid of a threat to our country (Saddam), but we have also helped Iraq more than anyone can imagine.  &lt;br /&gt;&lt;br /&gt;My company arrived here shortly after 3rd ID had captured Baghdad and essentially the Iraqi Army had been dissolved.  Then, most of the battle ground cities were without electricity, running water and other utilities.  Yes, those are consequences of battle.  We know that under Saddam, many people only had a few hours of electricity per day.  Well, looking at the state of the country now, I can make some observations.  If you don't agree with them, just reflect on this:  I'm here, and you're not.  I'm seeing them with my own eyes, you're not.  Driving through even rural areas of Iraq, I see lights on in every house.  This tells me they have electricity.  I see satellite dishes - yes satellite dishes - on almost EVERY rooftop.  Go figure.  I see bustling markets on the streets where people are buying and selling.  A quick look at the goods reveals the normal fruits, meats, vegetables, but I also caught glimpse of a digital satellite receiver for sale, TVs, microwaves, DVD players, gobs of DVD movies, cell phones, and so many more things that we only think of in modern countries.  Iraq is quickly importing all kinds of modern good that it did not have access to before because of Saddam.  &lt;br /&gt;&lt;br /&gt;While going through town and rural areas, the citizens are happy to see us.  They wave and smile.  Some have even said in broken English, “We happy you here.”  From my exposure to how Iraq is now, it is a better place than 1 year ago.  I'm proud to have served in this operation not only to serve my country, but I have met some of the people who will benefit from a new government in Iraq.  Capitalism runs through Iraqi veins.  Given the chance, the Iraqi economy will grow to a healthy size and sustain the citizens of the country.&lt;br /&gt;&lt;br /&gt;All in all, Iraq is in good shape.  Now if we could just get rid of the few terrorists who are making life tough for everyone. .  .&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173902418411515?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173902418411515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173902418411515'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173902418411515' title='A soldiers opinion on Iraq.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173895060642760</id><published>2004-04-11T20:02:00.000-07:00</published><updated>2004-04-11T20:05:19.436-07:00</updated><title type='text'>ASP.NET 1.1 Request Validation.</title><content type='html'>Well, this is a truly curious feature.  Yes, Kudos to Microsoft for implementing this security feature by default.  Now the responsibility has always and still does rest with the web developer.  In 1.0, and even back with ASP 2 and 3, the web developer was responsible for validating all input.  Remeber, all input is evil until it has been validated.  I imagine that a lot of beginning ASP.NET developers won't even know about the request validation feature of ASP.NET 1.1, but recently, I came to blows with this feature.  I searched and searched, but in the end, I just had to turn it off.  Yes, I know, bad stuff.  Well, I had the need to accept script as input.  In particular, I allow site editing, and the user has complete control over the page.  Even ASP.NET code is valid as input, so the user can do whatever with the page.  Only trusted users, mind you.  So ASP.NET balked: “hey, you can input script”.  Anyway, there is no configuring this security feature as far as I know, so in the end I just had to disable the feature.  Now I'm in the habit of validating all input anyway, because rarely is there ever a field that can be just anything.  There is usually at least some restriction, so I've always validated my own input.  Well, now I'm accepting script as input.  &lt;br /&gt;&lt;br /&gt;Which brings me to the point of my post:  When displaying data from a database, always Server.HtmlEncode(your data).  What if the data contains a little emotiexpression ?  If you didn't HtmlEncode it, it wouldn't show up.  Also, this ensures that all the data gets displayed if otherwise it would be interpreted as markup of some sort.  So, Server.HtmlEncode() is your friend.&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173895060642760?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173895060642760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173895060642760'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173895060642760' title='ASP.NET 1.1 Request Validation.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-108173898093541784</id><published>2004-04-10T04:02:00.000-07:00</published><updated>2004-04-11T20:05:49.653-07:00</updated><title type='text'>Almost going home.</title><content type='html'>Well, tomorrow is Easter Sunday, and I've been in the Middle East for a few day short of 1 year.  I am very ready to be back home, but I have a few more days to go.  Violence popped up in several places in Iraq last week, and every redeploying unit has been put on hold, with some of them being extended another 4 months.  I really, really, hope that doesn't happen with my Unit.  We have already turned in all of our equipment, and guns, everything, and we're just waiting to go home.  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-108173898093541784?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173898093541784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/108173898093541784'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_04_01_archive.html#108173898093541784' title='Almost going home.'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-5825501.post-107332546440112691</id><published>2004-01-05T09:57:00.000-08:00</published><updated>2004-04-11T20:02:01.250-07:00</updated><title type='text'>Introduction</title><content type='html'>For the last year plus, I've been deployed with the Army Reserves with the war in Iraq.  Actually, the war is over, but not really.  We control the government, but terrorists continue to attack randomly and plan bombs on the road.  In my civilian job, I'm a software developer, and I just had to purchase a laptop so that I could fill my spare time with something productive.  I'm glad that I'm part of this conflict instead of the last war in Iraq in '90.  We have adequate Internet connectivity, and I'm able to connect my laptop to the Internet from time to time.  We can check email, and browse the web.  I'm actually writing this blog entry from the middle east.  Imagine that.  I've been able to download technical blogs with an RSS aggregator and dowload technical articles and code samples.  I've been able to keep up my skills as a .NET developer, and I've actually grown in my skill since being here.  I have a wonderful wife back home waiting for me.  I have 6 weeks to go, and then I'll be home.  I can't wait.&lt;br /&gt;&lt;br /&gt;Well, that's all for this blog entry.  In the future, I plan to make my own website to host my blog with different categories.  I'm limited on what I can do from here, so I'm using this cheezy Blogger tool that only has an Atom feed (sorry guys).  As soon as I get home I'll move this blog.  I get personal server back up at home and install .Text.  I have .Text on my laptop here, so I make posts offline, and then when i get a chance to go online, I can post my posts here.  By the way, if you know a better place to host this blog, let me know (this is temporary anyway).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5825501-107332546440112691?l=jpalermo.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/107332546440112691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5825501/posts/default/107332546440112691'/><link rel='alternate' type='text/html' href='http://jpalermo.blogspot.com/2004_01_01_archive.html#107332546440112691' title='Introduction'/><author><name>Jeffrey</name><uri>http://www.blogger.com/profile/12266037649365811764</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
