Great Silverlight Cache for ASP.NET Drop Down Lists

Most Silverlight examples are about the User Interface. XAML here, and video there, pretty this, and shaded that. But this post today on SilverlightShow.net is different.

They use the isolated storage of silverlight to act as a Client-Side cache for ASP.NET drop down lists.

A great blog post, that is very well planned and executed.

Credits: Thomas Kirchir

Arizona Technology … Where are you?

As you probably know, I run the AZGroups.com. It’s a simple calendar page, that shows what’s happening with technology user groups around the valley. It should be a single place to see what technology events are happening. Support your local community and user group by participating.

This morning, I’m sitting here in Phoenix (the 6th largest city in the U.S.) and I can’t name more than thirty (maybe forty if I really tried) software companies here in the valley off the top of my head. I’m sure there are hundreds. Of those thirty or forty companies, I know of them because of their participation in the community. Obviously there are the big guys we all know, Microsoft and GoDaddy, who have both been great supporters of the User Group sponsorship for events. But there are a ton of smaller (and larger) shops that are just invisible, flying under the radar going unnoticed. In my mind this is because they lack community participation.

So I thought I would ask.

What software company do you work for here in town? Give me a short description, and a link in the comments about your job, what you do for the company, and what the company (or software) does. If you’re company is already listed from a co-worker, feel free to leave your comments as well. I’m sure there is a directory or something online, but I’m not looking for a phone book, I’m looking for members who support the community.

AZGroups.com Feb 10, 2008 Meeting : Microsoft Enterprise Library

From the February AZGroups Calendar

Enterprise Library is a framework and collection of reusable components that allows developers to focus on delivering applications and less on building the plumbing. Enterprise Library was initially developed by Avanade and licensed to Microsoft and while it has evolved over the years, the core components and blocks remain the same.

During this presentation Nathan Smith – Solution Architect and SOA Capability Lead and Scott Kraus – Principal Solution Developer, from Avanade will provide an overview, with demonstrations, of how to integrate key components of Enterprise Library into your applications. Time permitting, the following blocks will be discussed: Caching, Data Access, Exception Handling, Logging, Policy Injection and Validation.

Join us, it’s fun, it’s free, and you’ll learn something 🙂

Windows 7 In Virtual PC 2007 and Virtual Machine Additions

I just installed my 3rd version of Windows7 (this time into a VPC Image) and I remember hearing online that there was a problem with Win7 running in VirtualPC2007. Something about the Virtual Machine Additions causing a blue screen on startup.

A quick search found this post, and in the comments I noticed the solution.

Update Virtual PC2007 to SP1. I didn’t even know there was an SP1 for Virtual PC, and maybe you didn’t either. I was running 6.0.156.0 (the old version). Check your VPC Version (Help|About) and make sure you’re updated to 6.0.192.0, and the Virtual Machine Additions should load and run fine in your Windows 7 VPC.

 

image

Presenting AJAX Client Templates from ASP.NET v4 Preview

Tonight (Jan 13, 2008 5:30-8pm) at the Arizona.net User Group, I’ll be presenting AJAX client templates currently available in the ASP.NET v4 Preview hosted on CodePlex.

Below is a quick code sample to wet your appetite.

C# / Service – Not really relevant to the call, but it’s where the data comes from

   1: [WebMethod]
   2: public List<Product> GetProducts()
   3: {
   4:     return GetProductsByOrderId(0);;
   5: }
   6:  
   7: [WebMethod]
   8: public List<Product> GetProductsByOrderId(int orderId)
   9: {
  10:     var productList = new List<Product>();
  11:     using (var adapter = new ProductsTableAdapter())
  12:     {
  13:         Northwind.ProductsDataTable products = null;
  14:         products = orderId > 0 ? adapter.GetDataByProductId(orderId) : adapter.GetData();
  15:         
  16:         foreach (var row in products)
  17:         {
  18:             productList.Add(new Product() { 
  19:                 Name = row["ProductName"].ToString(), 
  20:                 Id = (int) row["ProductId"]
  21:             });
  22:         }
  23:     }
  24:     return productList;
  25: }

ASPX Page

   1: <%@ Page Title="" Language="C#" MasterPageFile="~/Common/WebSiteMaster.master" AutoEventWireup="true" CodeBehind="A_Templates.aspx.cs" Inherits="ScottCateAjax2008.Lesson10.A_Templates" %>  
   2: <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
   3:   
   4: <asp:ScriptManager id="SM1" runat="server">  
   5:     <Scripts>  
   6:         <asp:ScriptReference ScriptMode="Debug" Path="~/Common/Scripts/ASPNET4Preview3/MicrosoftAjaxTemplates.js"  />  
   7:         <asp:ScriptReference Path="~/Lesson10/A_Templates.aspx.js" />  
   8:     </Scripts>  
   9:     <Services>  
  10:         <asp:ServiceReference Path="~/Services/NorthwindService.asmx" />  
  11:     </Services>  
  12: </asp:ScriptManager>  
  13:     
  14:     <h1>ASP.NET 4.0 - Templates</h1>  
  15:   
  16:     <table id="products" border="1" class="sys-template">  
  17:         <tr>  
  18:             <td>{{ Id }}</td>  
  19:             <td>{{ Name }}</td>  
  20:         </tr>  
  21:     </table>  
  22:   
  23: </asp:Content>  

JavaScript

   1: function pageLoad() {   
   2:     ScottCateAjax2008.Services.NorthwindService.GetProducts(goGetProducts_Callback, errorCallback);   
   3: }   
   4:   
   5: function goGetProducts_Callback(results) {   
   6:     var products = $create(Sys.UI.DataView, {}, {}, {}, $get("products"));   
   7:     products.set_data(results);   
   8: }   
   9:        
  10: function errorCallback(error) {   
  11:     alert(error);   
  12: }  

Outcome

imageArizona.net User Group, I’ll be presenting AJAX client templates currently available in the ASP.NET v4 Preview hosted on CodePlex.

Below is a quick code sample to wet your appetite.

C# / Service – Not really relevant to the call, but it’s where the data comes from

   1: [WebMethod]
   2: public List<Product> GetProducts()
   3: {
   4:     return GetProductsByOrderId(0);;
   5: }
   6:  
   7: [WebMethod]
   8: public List<Product> GetProductsByOrderId(int orderId)
   9: {
  10:     var productList = new List<Product>();
  11:     using (var adapter = new ProductsTableAdapter())
  12:     {
  13:         Northwind.ProductsDataTable products = null;
  14:         products = orderId > 0 ? adapter.GetDataByProductId(orderId) : adapter.GetData();
  15:         
  16:         foreach (var row in products)
  17:         {
  18:             productList.Add(new Product() { 
  19:                 Name = row["ProductName"].ToString(), 
  20:                 Id = (int) row["ProductId"]
  21:             });
  22:         }
  23:     }
  24:     return productList;
  25: }

ASPX Page

   1: <%@ Page Title="" Language="C#" MasterPageFile="~/Common/WebSiteMaster.master" AutoEventWireup="true" CodeBehind="A_Templates.aspx.cs" Inherits="ScottCateAjax2008.Lesson10.A_Templates" %>  
   2: <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
   3:   
   4: <asp:ScriptManager id="SM1" runat="server">  
   5:     <Scripts>  
   6:         <asp:ScriptReference ScriptMode="Debug" Path="~/Common/Scripts/ASPNET4Preview3/MicrosoftAjaxTemplates.js"  />  
   7:         <asp:ScriptReference Path="~/Lesson10/A_Templates.aspx.js" />  
   8:     </Scripts>  
   9:     <Services>  
  10:         <asp:ServiceReference Path="~/Services/NorthwindService.asmx" />  
  11:     </Services>  
  12: </asp:ScriptManager>  
  13:     
  14:     <h1>ASP.NET 4.0 - Templates</h1>  
  15:   
  16:     <table id="products" border="1" class="sys-template">  
  17:         <tr>  
  18:             <td>{{ Id }}</td>  
  19:             <td>{{ Name }}</td>  
  20:         </tr>  
  21:     </table>  
  22:   
  23: </asp:Content>  

JavaScript

   1: function pageLoad() {   
   2:     ScottCateAjax2008.Services.NorthwindService.GetProducts(goGetProducts_Callback, errorCallback);   
   3: }   
   4:   
   5: function goGetProducts_Callback(results) {   
   6:     var products = $create(Sys.UI.DataView, {}, {}, {}, $get("products"));   
   7:     products.set_data(results);   
   8: }   
   9:        
  10: function errorCallback(error) {   
  11:     alert(error);   
  12: }  

Outcome

image

” width=”467″ border=”0″ />