Philly.Net’s November meeting is a return to the "15 Minutes of Fame" format.  We had 10 speakers each providing a 15 minute presentation.  Sort of a geek sampler.  In addition to my duties as Swag Man (if you don’t know, I gather all of the prizes), I’m doing a 15 minute presentation on LINQ. 

With 15 minutes, I’m not getting into too much detail.  Just a bunch of cool code sample to show what LINQ is capable of.  Mostly, LINQ to SQL.  If you are interested, here is the code sample solution.

If you want to learn more about LINQ, here are some site to check out:

Scott Guthrie’s Blog:  http://weblogs.asp.net/scottgu/  (Of Course!)

Wes Dyer’s Blog: http://blogs.msdn.com/wesdyer/  (this guy knows his stuff on LINQ!)

Check out this great video by Wes.  It explains a lot, it is definitely worth watching:  http://wm.microsoft.com/ms/msdn/visualcsharp/wes_dyer_2007_01/WesDyer_0002.wmv

Philly.Net’s November meeting is a return to the “15 Minutes of Fame” format.  We had 10 speakers each providing a 15 minute presentation.  Sort of a geek sampler.  In addition to my duties as Swag Man (if you don’t know, I gather all of the prizes), I’m doing a 15 minute presentation on LINQ. 


With 15 minutes, I’m not getting into too much detail.  Just a bunch of cool code sample to show what LINQ is capable of.  Mostly, LINQ to SQL.  If you are interested, here is the code sample solution.


If you want to learn more about LINQ, here are some site to check out:


Scott Guthrie’s Blog:  http://weblogs.asp.net/scottgu/  (Of Course!)


Wes Dyer’s Blog: http://blogs.msdn.com/wesdyer/  (this guy knows his stuff on LINQ!)


Check out this great video by Wes.  It explains a lot, it is definitely worth watching:  http://wm.microsoft.com/ms/msdn/visualcsharp/wes_dyer_2007_01/WesDyer_0002.wmv

LINQDemo.zip (94.67 KB)

I learned something new today, thought I’d share it.  Actually, I think I relearned it, it sounded familiar.  There are so many features to .Net these days it is tough to remember everything.  Anyway, here we go.

Did you know that you can put content directly inside a ContentPlaceHolder of a MasterPage?  I’m not talking about in a page’s asp:Content control that matches up to the Master’s asp:ContentPlaceHolder.  That is what we typically do.  But you can put content in the asp:ContentPlaceHolder control on the master.  I like to think of it as default content.  In the content page, if you put content inside the asp:Content control, it will override the "default" value from the Master.  If not, the Master’s content will be shown.  Content, Content Pages, asp:Content, asp:ContentPlaceholders…confused?  Here’s a simple example:

Here is some code from body of our MasterPage.  I’m only including the body to save space.  We have 2 contentplaceholders.  The first has some "default text"

<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
            By Default, show this.
        </asp:ContentPlaceHolder>
    </div>
    <div>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>

Now let’s look at our first ContentPage.  It puts text in each of the Content areas:

<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="WebForm1.aspx.cs" Inherits="MasterPageSample.WebForm1" 
Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    content in placeholder 1
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    content in placeholder 2
</asp:Content>

Next comes our second ContentPage.  This one only has one asp:Content control to match the second ContentPlaceHolder from the MasterPage:

<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="WebForm2.aspx.cs" Inherits="MasterPageSample.WebForm2" 
Title="Untitled Page" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    content in placeholder 2
</asp:Content>

The last ContentPage has 2 asp:Content controls but only the second one has actual content. The first one is empty:

<%@ Page Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" 
CodeBehind="WebForm3.aspx.cs" Inherits="MasterPageSample.WebForm3" 
Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    content in placeholder 2
</asp:Content>

So what are the results?  The first page renders both pieces of content:

image

The second one shows it’s content and since the first ContentPlaceholder wasn’t matched up with a Content control, it shows the content from the MasterPage:

image

The last page has both ContentPlaceHolders matched up, only the first has no content at all.  So in this case, it overrides the "default" content from the master with nothing!  All you get is the content from the second Content control:

image

Pretty cool, huh?

We’ve got lots of stuff going on with Philly.Net these days.  Here is some news that I thought would be worthwhile.

Next Meeting:  "15 Minutes of Fame" on November 20, 2007 – Instead of having only two speakers, we’ll have 10 speakers, each doing about 15 minutes!  We did this last year for our Nov. meeting and we got great feedback so we’ll try it again.  I’m looking forward to it, I’ll be doing my 15 minutes on LINQ.  For more information, check out the web site

Visual Studio 2008 is Coming Soon – This isn’t exactly Philly.Net news but I thought it was worth mentioning.  Check out the Visual Studio Developer Center for the details.  Microsoft announced at TechEd in Barcelona that VS 2008 and .Net Framework will be released this month!

Future Meetings – We’ve got lots of good stuff coming soon including regular meetings, Code Camps, Pub Nights and some special events.  If you are interested in speaking or sponsoring, please let us know.  We need sponsors and speakers starting with January Code Camp and also the February monthly meeting.  If you have never spoken, I advise you to give it a try.  It is fun and you’ll actually learn a lot from the process.

Architects Group – Mitch Ruebush is starting up a User Group for Architects.  Keep an eye out for more information.

We’ve got some other things that we’re working on.  Plans for Code Camp, newsletters and more.  You’ll be hearing more about that soon.