Archive for June, 2010

Blog Comments Re-Enabled.

I’ve turned comments back on (please feel free to comment.)

Thanks to @Meligy for the reminder.

I had to turn them off after several days an automated comment span attack.


Making ASP.NET Buttons Match the default WebSite Template.

6-30-2010 10-42-02 AM

 I’m working on a couple of demo application in ASP.NET Web Forms and I noticed that, like in many themes I encounter, Button objects don’t match the theme and lack mouseover effects.

So here is how you make your ASP.NET Button control instances match other “clickable” objects in the default ASP.NET Web Site template (like the menu tab).

Open the Site.css file in the Styles folder of your solution and add the following 2 CSS classes.

Code Snippet
  2. .button {   
  3.    color: White;   
  4.    background-color: #465C71;
  5.    border:1px solid;   
  6.    border-color: Gray;   
  7. }   
  9. .buttonhover {   
  10.    color: White;   
  11.    background-color: #BFCBD6;
  12.    border:1px solid;   
  13.    border-color: Gray;   
  14. }

Now when you add an ASP.NET Button Control to your page, set the CssClass to button and add html onmouseover and onmouseout attributes as follows.


Code Snippet
  2. <asp:Button ID="Button1" runat="server" Text="Button" CssClass="button"
  3.             onmouseover="this.className=’buttonhover’"
  4.                          onmouseout="this.className=’button’"  />


By default your buttons still look like vanilla buttons but when you want, this method will make your buttons match your site’s theme.


Technorati Tags: ,,

If you are a Senior .NET Developer in the RI area ….

Becker Professional Search is looking for a Sr.Net Developer for a $2 Billion dollar client located in Northern, RI .

Skill requirements

  • 5 or more years of related development experience.
  • Technical proficiency in ASP, .NET, C#, SQL (MS SQL SERVER). XML, VB.NET, Javascript, HTML, CSS, AJAX,
  • Object Oriented Analysis and Design and Visual Source Safe.

Also desired

  • Proficiency in ASP Classic
  • Adobe Dreamweaver
  • User Interface Design
  • Cross Platform/Browser
  • Flash, Photoshop and/or Fireworks.

Interested parties may contact Patrick Halpin at

5 More Tailspin Spyworks Videos Now Live

6-29-2010 1-18-56 PM

The content team ahs pushed 5 more of my Tailspin Spyworks sample application videos live for your viewing pleasure.

TailSpin SpyWorks – Adding Items to the Shopping Cart

TailSpin SpyWorks – Display Shopping Cart

TailSpin SpyWorks – Update the Shopping Cart

TailSpin SpyWorks – Migrate the Shopping Cart

TailSpin SpyWorks – Final Check Out

Work continues …….

Add your recent Tweets to your web site.


Twitter continues to gain in popularity, in part because it offers a rich and easy to use query API.

Just for fun I made an ASP.NET Web Forms User Control to Display some recent Tweets on a web page.

The tweets are displayed in a ListView as follows.

Code Snippet
  1. <%@ Control Language=”C#” AutoEventWireup=”true” CodeBehind=”MyTweets.ascx.cs” Inherits=”NETOOP.Controls.MyTweets” %>
  2. <%@ OutputCache Duration=”3600″ VaryByParam=”None” %>
  3.     <asp:ListView ID=”MyTweetsListView” runat=”server”>
  4.         <LayoutTemplate>
  5.             <table class=”gridview”>
  6.                 <th>My Tweets</th>
  7.                 <tbody>
  8.                     <asp:PlaceHolder ID=”itemPlaceholder” runat=”server” />
  9.                 </tbody>
  10.             </table>
  11.         </LayoutTemplate>
  12.         <ItemTemplate>
  13.             <tr>
  14.                 <td><a href=’<%#Eval(“Url”)%>‘><%#Eval(“Title”) %></a></td>
  15.             </tr>
  16.         </ItemTemplate>
  17.     </asp:ListView>

Note the use of the OutputCache directive so the Twitter API doesn’t need to get called for very single request of any page that contains this control.

Since Microsoft’s .NET is so XML savvy and LINQ to XML is so powerful the C# code to fetch the tweets and bind to the ListView is pretty straight forward.

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.UI;
  6. using System.Web.UI.WebControls;
  7. using System.Xml.Linq;
  9. namespace NETOOP.Controls
  10. {
  11.     public partial class MyTweets : System.Web.UI.UserControl
  12.     {
  13.         protected void Page_Load(object sender, EventArgs e)
  14.         {
  15.             XNamespace slashNamespace = “”;
  17.             XDocument rssFeed = XDocument.Load(“” + “?count=5”);
  19.             var posts = from item in rssFeed.Descendants(“item”)
  20.                         select new
  21.                         {
  22.                             Title = item.Element(“title”).Value,
  23.                             Url = item.Element(“link”).Value,
  24.                         };
  26.             MyTweetsListView.DataSource = posts;
  27.             MyTweetsListView.DataBind();
  28.         }
  29.     }
  30. }


Notice that he URL in the XDocument.Load specifies “misfitgeek.rss” to pull my personal tweets (which you can include on your web site if you like). You could change the portion of the URL to reflect your own Twitter name.

Technorati Tags: ,,

Alachisoft’s new version of NCache announced at TechEd !

Before coming to Microsoft I owned a consulting company that specialized in solving performance and scalability problems in web applications.

It always amazed me how many seeming huge problems could be solved with a little strategic caching implementation.

Alachisoft’s NCache is a PREMIER provider of advanced caching technology for ASP.NET.

Though ASP.NET has caching functionality built in, NCache can help you take caching in your application to the next level.

Here are some of the NEW features.

  • Dashboard Style Monitoring Tool: With this tool, you can now monitor all aspects of your cache and application live. You get a dashboard which can be customized according to your monitoring needs.
  • LINQ Support: NCache now provides LINQ integration with IQueryable interface that makes cached items searchable.
  • Entity Framework (EF) Caching: Now you can do seamless integration with EF caching. Plug in at the ADO level and use NCache caching without any code changes.
  • .NET Cache Provider 4.0: Integration with .NET Cache provider 4.0 – with Change Monitors (file based, key based, database dependency) for managing cache dependencies.
  • Streaming API: With streaming support in the API, now you can read and write binary data stream in the cache.
  • Multiple Providers for ReadThru/WriteThru: Develop multiple ReadThru/WriteThru providers and register with NCache. You can use a specific provider from each of your application..
  • Dynamic ReadThru/WriteThru Deployment: Use NCache Manager to deploy your ReadThru/WriteThru handlers even at runtime. Your assemblies are automatically copied to all the cache servers.
  • Runtime Compact Serialization (no programming needed): Use a faster and more compact serialization than regular .NET serialization and without writing any custom code for it. NCache generated serialization code at runtime and even lets you serialize objects that are otherwise not serializable.
  • ViewState Caching: Cache ViewState at your web server and reduce the payload being returned to the browser and speed up response time.
  • Merge & Minify Javascript/CSS: Minify and merge multiple JavaScript files. This reduces the payload sent to the browser and also the number of HTTP calls the browser makes to the web server. The results is faster response time.
  • Protocol-level Backward Compatibility for Clients: NCache 3.8 offers protocol-level backward compatibility from now on. This means any future upgrades would be 100% backward compatible at protocol-level.
  • Remote Client Management from NCache Manager: Configure Remote Clients from NCache Manager and easily change individual client settings all from a single point.

One of the especially cool things about NCache is the FREE Express version (Limited to 2-server clusters with local clients) – this lets you prove your strategy before spending anything but time 🙂

You can get started by going to