News Archives 
   
(click month to expand)
  

Recent Technology News Stories

Solentive News
Delay Content Loading with AJAX.NET Toolkit  [click for more...]

A while back I wrote an article for CodeProject that was just a simple demonstration of how to load portions of content after the initial page load using AJAX.NET

Basically, using a timer and an update panel, this user control loads some RSS headlines after the initial page load.  Simple and straightforward.  Sample code is provided in VB and C# and there is also an online demo.

30/10/2007   [Link]
Delayed Content Loading Using the AJAX.NET Timer and UpdatePanel  [click for more...]
A tutorial for loading sections of a page after the main page has loaded. This example uses the Timer and UpdatePanel controls in the AJAX.NET Framework to load content.
30/10/2007   [Link] Joshua Stengel
My First Silverlight Streaming Project  [click for more...]
I had a short video that I needed to share with family this weekend so I thought I'd try out the Silverlight streaming service that's currently free. I started out with this guide Your Video to Silverlight Streaming 101 which seemed pretty straight forward....(read more)
30/10/2007   [Link]
Gallery Server Pro - An ASP.NET gallery for sharing photos, video, audio and other media  [click for more...]
Gallery Server Pro is a complete, stable ASP.NET gallery for sharing photos, video, audio and other media. This article presents the overall architecture and major features.
30/10/2007   [Link] Roger Martin
Dynamic Images with ImageTemplate.NET  [click for more...]
ImageTemplate.NET lets you easily generate images dynamically for use on your website.
30/10/2007   [Link] flipmind
Generic Parameter Inference  [click for more...]
public static void Do<T>(this TBase value) where T : BaseClass<TBase>

The above line of code does not compile. I've been mulling over this for about half an hour and have not come up with a single logical reason why it shouldn't, strong-typing wise, except that it doesn't.

I can understand why using Type Inference (calling the method without the generic parameter), you could never bind to one predetermined T - after all, there may be an infinite amount of types that derive from BaseClass<TBase> and that's just when using TBase's topmost level of inheritance.

However, using a call to Do with the T generic parameter explicitly stated, there can be only one option for TBase, since:

  1. It is a class and you can never derive twice from the same type in your line of inheritance, so there's no fearing that T would derive from both BaseClass<A> and BaseClass<B> somewhere along that line.
  2. It is not an interface, where you could implement both ISomething<A> and ISomething<B>

Does anyone have any ideas?

30/10/2007   [Link]
Visual Studio Tip: Use Code Snippets  [click for more...]

There is a little used function of Visual Studio that will save you a lot of coding time: Code Snippets. Code Snippets are handy key shortcuts that expand into commonly used .NET constructs such as regions, constructor, loops (do/while/for/foreach), and try/catch blocks. To use a code snippet you can type in its 'shortcut' and in Intellisense you will see a little piece of paper next to the word indicating that it is indeed a code snippet. Then you press TAB twice, and the code snippet is expanded into the full construct, and depending on the snippet you may be directed to enter some pertinent information.

Let's try my favorite example: a property declaration with a backing field.

  1. Type in prop and then press TAB twice
  2. You will see an expanded property declaration with green fields, indicating that you need to supply this information.
  3. The first field to fill in will be highlighted in blue, which in this case is 'int'. Let's type 'string' to make a string property, but any .NET type will work.
  4. Now hit TAB again to go to the next field, which is the name of the private variable. Let's call it _stringProperty.
  5. Press TAB again to go to the public property name. Notice that it filled in the get/set values of the private variable for you. Now you can call the public string StringProperty, and press ENTER to indicate that you are finished (if you press TAB, you will cycle back through the customizable fields).

Now this saves me a lot of time since I can create properties rapidly instead of typing curly braces and get/set over and over. Other huge time savers include foreach/for, try, and cw (which does a Console.WriteLine()).

30/10/2007   [Link]
UPS Address Validation Sample with ASP.NET C#  [click for more...]
UPS Online Tool Address Validation Sample with ASP.NET C#
30/10/2007   [Link] Benz CPE
How to upgrade from .NET Framework 1.0 to .NET Framework 3.5  [click for more...]
With .NET 3.5 being released about the end of the year at the same time as Visual Studio 2008 it's a good time to look around for any remaining .NET 1.0 or .NET 1.1 applications and consider upgrading them. How do you do it? Does it seem overwhelming?...(read more)
30/10/2007   [Link]
NBC, Fox launching online video site (AP)  [click for more...]
AP - NBC and Fox are set to launch an advertising-supported online video site that hosts programming from varied entertainment companies in a bid to seize viewers from Google Inc.'s YouTube, the broadcasters said.
30/10/2007   [Link]
Notes: A MSDN Websites style Custom Notes control in ASP.NET and C#  [click for more...]
A Microsoft Website Style notes control using a Webusercontrol in ASP.NET and C#
30/10/2007   [Link] Abhijit Jana
Assembly Fun in ASP.NET  [click for more...]

I used to be a big fan of Assembly (x86) in the past when doing graphics for the ancient 320x200x256 and later when lecturing about 80x86 to practical engineers. These days I don't do that anymore, but I think knowing the basics does make sense.

This project is nice - it allows to run x86 code in ASP.NET.

 

30/10/2007   [Link]
Developing COM Add-ins for Microsoft Office in VB.NET  [click for more...]
This article describes the ways a VB.NET developer can create a COM Add-in for Microsoft Office 2000, 2002 (XP), 2003, and 2007 in order to customize Office applications including adding UI elements and event handling.
30/10/2007   [Link] Andrei Smolin
Change of plans for Acropolis and WPF composite client support from Microsoft  [click for more...]

Back in June, Microsoft announced Acropolis. Now, the Acropolis team and the Patterns & Practices team announce new plans.
I haven't looked at Acropolis after July, and this new change of plans confirms that this was a wise decision. These days, I don't really have time to spend on moving targets like Acropolis was.

The Acropolis team announce that Acropolis enters a new phase. They "will begin to roll many of the Acropolis concepts into future versions of the .NET Framework for the desktop and Silverlight". Yet, no new previews are planned!
At the same time, the Patterns & Practices team announce that they will provide WPF Composite Client, "guidance (samples, applications blocks, patterns and so on) for building composite client applications for .NET Framework 3.5 and Visual Studio 2008". The target is to have all of the new guidance ship before the end of 2008. They plan to "develop several small deliverables that they will ship in a piecemeal fashion", but no dates set for these.

In the meantime, the official recommendation is to stick to CAB and SCSF, and use the Windows Forms and WPF interop if you need WPF in your composite applications.

For more information about the future of Acropolis and the WFP Composite Client, read the announcements on the Acropolis blog and on Glenn Blocks' blog.

30/10/2007   [Link]
ASP.NET “Soup to Nuts” Webcast Series  [click for more...]
During November Microsoft’s Ron Cundiff will be presenting a series of four “Soup to Nuts” webcasts in which he discusses the basics of using ASP.NET to create your first Web applications. More advanced developers are encouraged to check out the Webcasts page to register for upcoming presentations on ASP.NET, AJAX, Silverlight, IIS, and SQL Server.
30/10/2007   [Link]
AJAX Control toolkit and TFS Presentations  [click for more...]

Tuesday 30th October and Wednesday 31st October, I am doing a presentation on the AJAX Control Toolkit. It is part of the readify developer network series of presentations. I am doing a primer presentation which is more introductory and runs for a relatively short period of time. Chris Burrows will then follow through with a Team Foundation server related presentation based on experiences in the field.

Tuesday there are 2 sessions (morning and night) in Sydney, and Wednesday there is 1 afternoon session in Canberra. Melbourne will also have a similar series of presentations on Thursday.

For more details and also to register for the events, visit here http://www.readify.net/rdncalendar.aspx .

30/10/2007   [Link]
Grabbing Data from a GridView on PostBack  [click for more...]

Have you ever wanted to grab bulk data on a grid view? It's actually not that hard at all. Set the System.Web.UI.WebControls.GridView.DataKeys Property on the Grid, then on the postback event iterate over the grid like so.

   1:  foreach (GridViewRow row in gridView.Rows) 
   2:  { 
   3:      DataKey data = gridView.DataKeys[row.RowIndex]; 
   4:      int Id = (int)data.Values["Id"]; 
   5:      TextBox myControl = row.FindControl("mycontrol") as TextBox; 
   6:      //do something with the data
   7:  } 

And on your GridView add the DataKeys Property

   1:  <asp:GridView ID="myGrid" runat="server" 
   2:       DataSourceID="myDataSource"
   3:       DataKeyNames="Id" >
30/10/2007   [Link]
.NET 2.0 Cast operator vs. As operator  [click for more...]

When I was converting untyped data values from a SQL database into a custom Business class, I realized that I has to take special precaution when casting possibly null values. If you try to cast a null object to some type, you will get an InvalidCastException. When thinking about a solution, I remembered the As operator and decided to do some investigating. Consider the following example:

object objstr = null;
string str1 = (string)objstr; //Cast throws an Exception
string str2 = objstr as string; //No exception is throw, and str2 == null

So it turns out that the as operator is just like the cast operator except that it yields null on conversion failure instead of throwing an exception. Looking at a MSDN C# Programmer's Reference page http://msdn2.microsoft.com/en-us/library/cscsdfbt(vs.71).aspx confirmed this, and even offered up the following explanation.

expression as type
 
//is equivalent to
 
expression is type ? (type)expression : (type)null

                        
30/10/2007   [Link]
Copyright © 2007 Solentive | Disclaimer | Contact | Home