Thursday, December 17, 2009

Showing Progress of a ASP.NET MVC PartialView

What you’ll need for this recipe:

  1. Some long running GET that you really don’t want the rest of the page load to wait for.
  2. New ActionResult in a Controller that returns a PartialView.
  3. ViewUserControl that will display the results of your long running GET.
  4. jQuery and a javascript snippet that will go call your action and load your result.

Step 1 – Action Result

   1: public ActionResult CreateData(int item) 
   2: { 
   3:     // Go to your Model/API/Service and get the long running stuff
   4:     List<String> LargeList = Model.GoGetList(item);
   6:     // You can either add it to the ViewData or return it.. 
   7:     // Do what you like
   8:     ViewData.Add("ElementIdS", group.ElementIds); 
  10:     // Go return your control.. 
  11:     //it's named the same as you *.ascx file
  12:     return PartialView("UserControl"); 
  13: }

Step 2 – ViewUserControl

Go create you *.ascx file.  This one could be call UserControl.ascx.  Add some HTML to render your long running piece of data.

Step 3 – jQuery

   1: <script language="javascript" type="text/javascript" >
   2:     // just run at page load time
   3:     jQuery(document).ready(function() {
   4:         // this is the name of the empty div
   5:         // that you'll load with your PartialView and data
   6:         var targetDiv = $("#divTarget");
   7:         // this is just like the old UpdatePanel Progress stuff
   8:         var ajaxLoading = '<img id="ajax-loading" src="<%= Url.Content("~/Content/images/loading.gif") %>" height="20px" width="20px" />';
   9:         // go call your Controllers action called Create Data
  10:         var action = '<%=Url.Action("CreateData", "Home", new RouteValueDictionary(new { item = Model.Id }))%>'
  11:         // for now we are loading.. it's not done yet
  12:         $(targetDiv).html(" " + ajaxLoading + " Loading... ");
  13:         // lets go get our ActionResult.. with get
  14:         // we just pass the url and name the result.. "result"
  15:         $.get(action, null, function(result) {
  16:             //  pretty fade
  17:             $(targetDiv).fadeIn('slow');
  18:             // make the html in the target div the result of the PartialView
  19:             $(targetDiv).html(result);
  20:         });
  21:     });
  22: </script>

Step 4 – Hook it up and run

Run.  It works.

Friday, October 23, 2009

I'm Sold!

Ok Microsoft.  You got me.  I'm sold.  How did you know that is exactly what I would have wanted from the start.  The new default environment settings are awesome.

Based on "Web Development" settings but additionally optimizes for maximum text editor space by hiding tool windows, tool bars, and non-essential UI.  Design View, validation, and non-essential background processes are also disabled.

Friday, August 28, 2009

St. Louis Day of .NET

I just had a great session at St. Louis Day of .NET. If you attended, please go rate me.

Check out this great SlideShare presentation on LinkedIn titled Sql Azure - St. Louis Day of .NET. Click on the link to view the presentation.



Thursday, August 20, 2009

Thursday, July 9, 2009

Microsoft SQL Services is now Microsoft SQL Azure

Microsoft SQL Azure




If you haven't heard, Microsoft changed the name of SQL Server in the cloud again.  I guess they don't want people thinking that they are paying for a SQL service but paying for a SQL Azure.  Guys, come on.  I know it's not marketed very well but changing the name again.  SSDS, SDS, now what is it? MSA MSAD.

The reason why people haven't adopted it is because it's still CTP.  Once you get the new version out to public CTP it would have gone off like a rocket.  Sorry for the rant but I liked Microsoft SQL Data Services much better. 

Data Platform Insider

By the way, in case you are new to Azure, Azure is a color.  It's kind of like a cyan-blue.  Azure is also what Microsoft seems to be calling everything they put in the cloud nowadays.

Monday, June 29, 2009

Free High Availability Book

For a limited time, Perpetual Technologies, Inc. is offering a FREE copy of the following publication to clients, friends, and colleagues of Perpetual Technologies.

So contact PTI today to receive a complimentary copy of our latest book!

Contact PTI for your free copy

Monday, June 22, 2009

Speaking at St. Louis Day of .NET

I've been chosen to speak again on SDS.  This time I'll be in St. Louis MO.  It's a very cool location to have a conference so I hope that if you are available you attend. 


The Benefits Of SQL Server Data Services

Organizations often face challenges in managing their IT infrastructure when they are growing rapidly. In such situations, they may need to increase their data storage capabilities. Consequently, a large amount of time is spent in ramping up server capacity. This leads to increased installation and maintenance costs. SQL Server Data Services helps organizations overcome these challenges. This talk will focus on the benefits, features, object model and ease of use of SQL Server Data Services. Learn how your projects can benefit from a hosted data storage and query processing service. See by example how to design your program to use SQL Server Data Services.



Ameristar Casino and Conference Center
St. Charles, MO

Friday and Saturday
August 28th and 29th, 2009

Tuesday, June 9, 2009

CodeStock Agenda


The final schedule for Codestock has been posted at  I'm scheduled to speak about SQL Data Services (SDS) at 9:30 AM on Friday the 26th.  This is the second time in a row that I'm an opening speaker at an event.  I wonder if I could get a mid-day event next time I speak.  I guess they have the new guys wake the developers up in the morning. 

If you are planning on hearing me speak, plan on getting stuff thrown at you.  I ask almost as many questions of the crowd as they ask of me.  I'll be jacked up on caffeine and I love talking about data in the cloud.  Here is a list of some talks I think are interesting and I hope to catch them all:

Data Syncing using SQL Server Data Services
  -  Aaron King

New Agile Features in Team System 2010
  -  Tommy Norman

Using Custom Classes in SQL Reporting Services
  -  Dana Coffey

Get Funded: What you need to know NOW!
  -  Rachael Qualls

Deployment and Packaging SharePoint solutions using TFS
  -  Rob Gillen

Introducing the MVVM Pattern
  -  Brian Genisio

Don't Be Blue: Azure is Here to Brighten Your Day
   -  Michael Brown

WPF Databinding ++
   -  Kirstin Juhl

New Approach to HttpRuntime.Cache Management
  -  David L. Penton

How to make your application awesome with JSON,...
   -  James Bender


Tuesday, June 2, 2009

Wednesday, May 20, 2009

Wednesday, April 29, 2009

CodeStock 2009 Aftermath

Me @CodeStockIf you did not attend CodeStock 2009, then you really missed out.  It was one of the best conferences I have ever been to.  I've been to a lot, so that means something.  I've learned more, I've recieved more swag, ate better but never came back so energized.

I met so many people that I will now probably follow for a very long time.  There are people that I have met at L.A., NYC, Chicago that were probably more popular, but I don't remember who they are.  I'll remember the people I met in Knoxville at CodeStock.

The knowledge I gained was not just what cool stuff is coming down from Microsoft this year, but I fixed problems and made decisions.  Alan Stevens orchestrated an Open Spaces portion of CodeStock that went far above what I had hoped.  I had to leave early on Friday but Saturday was all about getting stuff done. 

I also had a lot of fun with the family and at the after parties.  If you are thinking about going next year.  Check out these photo albums.  You'll see all the fun we had.

Alan Stevens' Blog

Alan Barber's Sky Drive


David Giard's Flickr

Michael Neel's Flickr


Wednesday, January 14, 2009

Dual Server TFS installation Reporting Services Edition error

I don't install Team Foundation Server too often anymore.  I've been doing a lot of development and not a lot of managing teams.  This is a good thing. 

The first thing you should to when doing a dual server install is run this query on your SQL Server.

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition') 

Then install Reporting Services on your Team Foundation Server according to this chart.  If not, it won't work. 

For this edition of SQL Server 2005 Reporting Services
Use this edition of the Database Engine instance to host the database
SQL Server 2005 Express Edition with Advanced Services
SQL Server 2005 Express Edition with Advanced Services (local only).
Workgroup Edition
Workgroup Edition (local only)
Evaluation Edition
Standard, Evaluation, Enterprise Editions (local or remote)
Developer Edition
Standard, Developer, Enterprise Editions (local or remote)
Standard Edition
Standard, Enterprise Editions (local or remote)
Enterprise Edition
Standard, Enterprise Editions (local or remote)