August 2007 - Posts
Scott Cate helps out the ADA with proceeds from Easy Search ASP. See if you can help out to. This is way important.
I wanted to mention some upcoming Community Oriented Events. They are:
What other events are upcoming?
Wally
PS. I'm not looking for VSLive, DevConnections and other major events.
Original url: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2007/08/22/asp-net-podcast-show-99-nested-master-pages-in-visual-studio-2008.aspx
Download as WMV
Download as M4V for iPod and Zune
Download as MP3 audio only
Show Notes:
This show is a video demo of creating a nested master page in Visual Studio 2008.
The source code for the parent master page is:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPageParentSimple.master.cs" Inherits="MasterPageParentSimple" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
Simple Parent Master Page.<br />
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>
The source code for the example child master page is:
<%@ Master Language="C#" MasterPageFile="~/MasterPageParentSimple.master" AutoEventWireup="false" CodeFile="MasterPageChildSimple.master.cs" Inherits="MasterPageChildSimple" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
Simple Child Master Page<br />
The location of the ContentPlaceHolder was the one hangup I had.<br />
<asp:ContentPlaceHolder ID="Content3" runat="server">
</asp:ContentPlaceHolder>
</asp:Content>
The source code for the example simple out page is:
<%@ Page Language="C#" MasterPageFile="~/MasterPageChildSimple.master" AutoEventWireup="true" CodeFile="DefaultSimpleMasterPageExample.aspx.cs" Inherits="DefaultSimpleMasterPageExample" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content3" Runat="Server">
this is some basic content. this is more content.
</asp:Content>
Here is some exact output (not a perfect match, but close).

If you want to see some more on nested master pages, check this post out:
http://morewally.com/cs/blogs/wallym/archive/2007/08/09/visual-studio-2008-thursday-august-9-2008.aspx
If you have an ASP.NET project that use ASP.NET AJAX, you should take a serious look at using Visual Studio 2008 today. The javascript debugging makes it all worth it. I was tracking an error today, and I would never have found out what was happening without seeing the breakpoints get hit in the IDE. It has helped me solve problem after problem. Its providing tangible benefits today! The productivity increase is amazing. And I am finding VS 2008 today is more reliable on Vista than VS 2005. This feature is just that important. And did I mention it makes a good floor wax and desert topping.................
I keep pimping my look at VS 2008, but Visual Studio 2008 is the real deal. http://morewally.com/cs/tags/My+life+with+Visual+Studio+2008/default.aspx
While Vista officially shipped at the end of January, 2007, I've had nothing but frustration with its reliability since I got it with my brand new laptop. I've really had a bad experience with the product. I've had random hangs of various applications and its been rather frustrating. Honestly, the product felt very much like it was rushed out the door. Granted, I am a developer, but I could hardly go an hour without a crash or a hang. Then, last week, like a bolt from the blue, MS released the new performance and compatibility updates.
http://support.microsoft.com/?kbid=938979
http://support.microsoft.com/?kbid=938194
I installed them and it was like night and day difference in my system. I'm not quite sure what exactly this resolved, but since then, I haven't had any issues. This has been awesome. Its like Vista has finally shipped.
I'll be Huntsville, AL on August 14 talking on .NET 3.5 and Visual Studio 2008 for ASP.NET Developers. I'm looking forward to this. The site for the user group is: http://vsdotnetug.org/DesktopDefault.aspx
For the past couple of weeks, I have been blogging regular posts on "My life with Visual Studio 2008."
http://morewally.com/cs/blogs/wallym/archive/tags/My+life+with+Visual+Studio+2008/default.aspx
I've started a new "thing" on my MoreWally blog. Its called "My Life With Visual Studio 2008." With it, I am going to touch on all the things I try and do with Visual Studio 2008. Some of these things will be funny, some great, and some will look like "WTF was he thinking." Anyway, please check it out
Original URL: http://aspnetpodcast.com/CS11/blogs/asp.net_podcast/archive/2007/08/01/asp-net-podcast-show-98-building-an-iis7-http-module.aspx
Subscribe <-- What you really want.
Download WMV
Download M4V - IPod and Zune
Download MP3 - Audio only.
Show notes:
- Windows Server 2008.
- Visual C# Express.
- Visual Web Developer Express.
- Class Library in C#.
- IHttpModule Interface.
- Init, Dispose.
- Begin/End Request Events.
- Other Server Events.
- Messaging?
- Web.Config.
- Example.
- IIS Manager.
- WebDev Server vs. IIS7 Service.
- Error and how to fix it.
Source Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Messaging;
namespace IISWatcher
{
public class WatchRequests : IHttpModule
{
public void Init(System.Web.HttpApplication app)
{
app.BeginRequest += new EventHandler(app_BeginRequest);
app.EndRequest += new EventHandler(app_EndRequest);
}
void app_EndRequest(object sender, EventArgs e)
{
//HttpApplication app = (HttpApplication)sender;
}
void app_BeginRequest(object sender, EventArgs e)
{
string strReturn = "\r\n";
HttpApplication app = (HttpApplication)sender;
string strAddress = app.Request.UserHostAddress;
string strUrl = app.Request.Url.AbsoluteUri;
string strQS = app.Request.QueryString.ToString();
RequestInfo ri = new RequestInfo();
System.Diagnostics.EventLog.WriteEntry("HttpModule",
"IpAddress: " + strAddress + strReturn + "URL:" + strUrl);
System.Messaging.MessageQueue msq = new MessageQueue(@".\private$\HttpModuleQueue");
ri.AbsoluteUri = strUrl;
ri.IPAddress = strAddress;
ri.QueryString = strQS;
msq.Send(ri);
}
public void Dispose()
{
}
}
public class RequestInfo
{
public string IPAddress;
public string AbsoluteUri;
public string QueryString;
}
}
Web.config for IIS7:
<configuration>
...................
<system.webServer>
<modules>
<add type="IISWatcher.WatchRequests" name="IIS7RequestWatcher"/>
</modules>
</system.webServer>
</configuration>
More Posts