Posts Tagged ‘tutorial’

Multi-Targeting

One of the big new features that have been advertised with Visual Studio 2008 is this thing called Multi-Targeting.  This lets you write code for .NET 2.0 (or 3.0) even though 2008 is written to work with .NET 3.5.  So, the theory is, you can still work on existing projects targeted for .NET 2.0.  Does this work?  Watch the video to find out.

del.icio.us Tags: ,

  

Technorati Tags: ,

Republished by Blog Post Promoter

How to properly access controls in the Master Page

One of the great new features in ASP.NET 2.0 has been the ability to use master pages to layout the common elements of the web site.  This certainly works better than top and bottom include files or top and bottom Web User Controls.  But at least with the user controls, if we wanted to access a control within it, the method to do so was pretty straight forward.  All you had to do was expose the control as a public property.  Or, better, create a pass through property on the control that sets or retrieves the inner control’s property.  By doing this, you could turn a side bar element on or off (as an example.)

While you can expose elements of a master page in a similar manner, anyone who’s done this knows there are a few gotchas along the way.  I’m going to tell you how to avoid the gotchas and you’ll have the added benefit of being able to access the controls on the master page even if you decide to use a different master page without having to change any code other than the master page directive at the top of the aspx page.

Read the rest of this entry »

Republished by Blog Post Promoter

Anonymous Types

Well, Connecticut had a small ice storm last night, and I’m one of the lucky ones who still has power.  So, let’s get to work looking at anonymous types in .NET.


Read the rest of this entry »

The Ternary Operator in VB.NET

I think this may be the last operator that I really miss in VB from my curly brace language experience.  Although, I have to admit, I wouldn’t have missed it all that much if they never added it.  There just isn’t a whole lot of use for it.

However, the Ternary operator is a REALLY nice feature to have available to you when you do need it.  It’s another one of those language features that falls under, “Just because it is there doesn’t mean you have to use it.”

If you’ve ever run into a situation where you just need a simple evaluation and assign a variable based on it.  Like this: Read the rest of this entry »

Object Initialization in CSharp 3.0 and VB.NET 9

Yesterday we looked at the new var keyword in CSharp.  This makes CSharp variable declaration similar to VB.  After all, they’ve had the DIM keyword for years which essentially does the same thing.

Today, we’re going to look at object initializers, which have been added to both CSharp and VB.

Read the rest of this entry »

Bear