<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Married Geek &#187; ASP.NET, jQuery, Web, JavaScript, and CSS blog</title>
	<atom:link href="http://www.marriedgeek.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marriedgeek.com</link>
	<description>My wife tolerates my home server</description>
	<lastBuildDate>Fri, 15 Jan 2010 22:50:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>It&#8217;s an early build, but still in development</title>
		<link>http://www.marriedgeek.com/index.php/2010/01/15/its-an-early-build-but-still-in-development/</link>
		<comments>http://www.marriedgeek.com/index.php/2010/01/15/its-an-early-build-but-still-in-development/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 22:46:34 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=484</guid>
		<description><![CDATA[I took the day off (well, it was supposed to be the morning, but we ran into complications) to visit the OBGYN with my wife in order to get a checkup on our collaborative project. Here&#8217;s an early screenshot of the latest build. In about nine weeks we should be able to find out the [...]]]></description>
			<content:encoded><![CDATA[<p>I took the day off (well, it was supposed to be the morning, but we ran into complications) to visit the OBGYN with my wife in order to get a checkup on our collaborative project. Here&#8217;s an early screenshot of the latest build.</p>
<p><a href="http://www.marriedgeek.com/wp-content/uploads/2010/01/ultrasound.jpg"><img class="aligncenter size-medium wp-image-485" title="ultrasound" src="http://www.marriedgeek.com/wp-content/uploads/2010/01/ultrasound-300x228.jpg" alt="" width="300" height="228" /></a></p>
<p>In about nine weeks we should be able to find out the sex. At that point, I can begin registering his or hers domain name.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2010/01/15/its-an-early-build-but-still-in-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quick module creation using TouchPointCMS</title>
		<link>http://www.marriedgeek.com/index.php/2009/10/03/quick-module-creation-using-touchpointcms/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/10/03/quick-module-creation-using-touchpointcms/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 17:26:56 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[ASP.NET and Web]]></category>
		<category><![CDATA[TouchPointCMS]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=454</guid>
		<description><![CDATA[Back from vacation. I took a week off in OBX to get my eyes off computer screens for a while. We didn&#8217;t have WIFI down there, which turned out to be a good thing since I was able to relax and only answer a minimal amount of work-related email (they had 2 PCs on site). [...]]]></description>
			<content:encoded><![CDATA[<p>Back from vacation. I took a week off in OBX to get my eyes off computer screens for a while. We didn&#8217;t have WIFI down there, which turned out to be a good thing since I was able to relax and only answer a minimal amount of work-related email (they had 2 PCs on site).</p>
<p>Anyway, I&#8217;m very excited about TouchPointCMS development. It&#8217;s looking to be a very promising and solid CMS with endless add-on functionality. It&#8217;s also amazing how much faster this version runs over the old adhoc&#8217;d versions. One of the last updates to TouchPointCMS was improving the caching mechanisms used throughout the site in order to decrease load times and save on server resources.</p>
<p><a href="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_modules.gif"><img class="aligncenter size-full wp-image-400" title="touchpoint_modules" src="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_modules.gif" alt="touchpoint_modules" width="580" height="213" /></a></p>
<p>I&#8217;m also finding that writing add-on modules now is incredibly easy. For example, we&#8217;re deploying TouchPointCMS for <a href="http://smart-spice.com" target="_blank">smart-spice.com</a> and they want to include a spice manager. We can do this pretty quickly, considering a basic module consists of roughly 3 core files (5 if using code-behind):</p>
<ul>
<li>The user control that the end user sees (.ASCX and .CS)</li>
<li>The user control that the CMS user sees for management (.ASCX and .CS)</li>
<li><em>A meta.config</em> file for SQL related to installation, deletion, generating instances, icon, etc.</li>
</ul>
<p>Essentially, that&#8217;s all you need for building a module. For the spice manager, I combined functionality from the included Blog and Photo Gallery modules to allow for a simple spice list manager with images. The front end user control is nothing more than a ASP.NET ListView control bound to the spices for that page.</p>
<p>The modules that you create are automatically loaded with the web page. If you want to customize the placement of the module, such as having a Events module off to the left or right sizes of your page, you can deselect the <em>Render Inline Module</em> option from the CMS. This will disable the automatic rendering of the module, allowing you to use the <em><strong>&lt;tpc:Event runat=&#8221;server&#8221; /&gt;</strong></em> instance to create a list of events wherever you like on your template file. If you want to use events from another page, just include the <em><strong>PageID=&#8221;6&#8243;</strong></em> attribute, where 6 is the page ID you wish to pull from.</p>
<p>Check back later for updated CMS development and release!</p>
<p><a href="http://touchpointcms.org" target="_blank"><strong>Learn more about TouchPointCMS</strong></a><strong>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/10/03/quick-module-creation-using-touchpointcms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Vacation stress levels</title>
		<link>http://www.marriedgeek.com/index.php/2009/09/29/vacation-stress-levels/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/09/29/vacation-stress-levels/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:59:30 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[Everyday Stuff]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=455</guid>
		<description><![CDATA[I found this amusing, and very true. This pretty much lined up with our recent vacation to the Outer Banks. Scary&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.marriedgeek.com/wp-content/uploads/2009/09/phd092809s.gif"><img class="size-medium wp-image-456 alignright" title="phd092809s" src="http://www.marriedgeek.com/wp-content/uploads/2009/09/phd092809s-300x192.gif" alt="phd092809s" width="300" height="192" /></a>I found this amusing, and very true. This pretty much lined up with our recent vacation to the Outer Banks. Scary&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/09/29/vacation-stress-levels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making the most of templates in TouchPointCMS</title>
		<link>http://www.marriedgeek.com/index.php/2009/09/28/making-the-most-of-templates-in-touchpointcms/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/09/28/making-the-most-of-templates-in-touchpointcms/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 03:44:52 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[ASP.NET and Web]]></category>
		<category><![CDATA[TouchPointCMS]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=473</guid>
		<description><![CDATA[When most people think of a website template, they generally think of it as simply an overall look and feel of your website. It may have a predefined color scheme using CSS, a sprinkle of JavaScript here and there and some content filled in. Generally, a web developer will break down the template, utilizing the [...]]]></description>
			<content:encoded><![CDATA[<p>When most people think of a website template, they generally think of it as simply an overall look and feel of your website. It may have a predefined color scheme using CSS, a sprinkle of JavaScript here and there and some content filled in. Generally, a web developer will break down the template, utilizing the CSS and JavaScript objects inside what would now be a nearly bare shell, after removing all the pre-populated filler. If you&#8217;re working with a CMS, you may have to do even more cutting up to work your new template styles into your dynamically generated content. Most pages may use the same template, others may have variations. It can become cumbersome and frustrating after a while, especially duringÂ maintenance.</p>
<p><a href="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_templates.gif"><img class="aligncenter size-full wp-image-404" title="touchpoint_templates" src="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_templates.gif" alt="touchpoint_templates" width="580" height="160" /></a></p>
<p>TouchPointCMS hopes to alleviate this, at least to an extent. After all, if we had a perfect solution, we&#8217;d all be developers. TouchPointCMS contains template folders, inside a dedicated <strong>templates</strong> folder located at the root. Inside the templates section of the CMS, you will see the list of template folders available, along with the one that is currently active. Inside of each template folder is essentially your entire website. By this, I mean that you&#8217;ll have any style or script folders, along with your content pages, such as home, interior, custom, etc (these pages must be ASP.NET pages ending in .ASPX).</p>
<p>The idea is that each content page will have a unique structure if needed. For example, your home page may contain a large introductory banner which will not be part of interior pages. You may have a page containing a sidebar of events or other content. Because TouchPointCMS is aimed at those who are even a little web savvy (and who isn&#8217;t these days?), the idea is to use the built-in Controls and Modules inside of these templates where needed. An example of a module can be <strong><em>&lt;tpc:PageContent /&gt;</em><span style="font-weight: normal;">, which will automatically display any content for that page or any type (such as a gallery page, or a web form). You may also choose to display individual modules anywhere you like on your template, such as </span><em>&lt;tpc:Form /&gt;</em><span style="font-weight: normal;"> to display the web form for that page. Specific controls such as </span><em>RichNavigation</em><span style="font-weight: normal;"> to enable a rich drop-down navigation bar</span><span style="font-weight: normal;">, </span><em>BreadCrumbs</em><span style="font-weight: normal;">,</span><em> </em><span style="font-weight: normal;">for showing your depth in the website, or </span><em>Topic</em><span style="font-weight: normal;">, for showing a reusable section of HTML content throughout your site. </span></strong></p>
<p>Once your templates have these modules, they can then be assigned to pages in your site. On the templates page in the CMS, you may not only choose your overall template, but set a default template for all your pages. Individually for each page, you may assign a template (home, interior, etc) from those available when editing that page in the CMS.</p>
<p>There is one requirement however. All your pages must use an ASP.NET Master page. Before getting scared, this is simply a shell to be used around all your template files. For example, we can assume that all your templates will have basic HTML elements that can be used throughout, such as <em>html </em>and<em> </em> <em>body</em> tags, as well as a list of included CSS and JavaScript files. Master pages are a good practice, as they enforce the re-use of content. You can have as much or as little repeated content in your Master page as you like. You may even have multiple Master pages. Also, in order to tie into the CMS, the Master page(s) must inherit from the <em>TouchPointCMS.Core.Template</em> class. Taking a look at one of the included modules will provide much insight to the basic structure.</p>
<p>From that point on, the rest is populating your site. Check back for more TouchPointCMS overviews!</p>
<p><a href="http://touchpointcms.org" target="_blank"><strong>Learn more about TouchPointCMS</strong></a><strong>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/09/28/making-the-most-of-templates-in-touchpointcms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TouchPointCMS beta is LIVE!</title>
		<link>http://www.marriedgeek.com/index.php/2009/09/15/touchpointcms-beta-is-live/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/09/15/touchpointcms-beta-is-live/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 05:48:47 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[ASP.NET and Web]]></category>
		<category><![CDATA[TouchPointCMS]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=446</guid>
		<description><![CDATA[TouchPointCMS Â is a simple, modular Content Management System built on top of ASP.NET 3.5. Due to be completed in the next couple weeks, it will be a free, open-source CMS for any Windows web server. The system supports SQL Express Edition by default but is configurable Â to use a SQL Server instance. Read more about [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_nav.gif"><img class="size-full wp-image-405 alignright" title="touchpoint_nav" src="http://www.marriedgeek.com/wp-content/uploads/2009/08/touchpoint_nav.gif" alt="touchpoint_nav" width="165" height="184" /></a>TouchPointCMS Â is a simple, modular Content Management System built on top of ASP.NET 3.5. Due to be completed in the next couple weeks, it will be a free, open-source CMS for any Windows web server. The system supports SQL Express Edition by default but is configurable Â to use a SQL Server instance.</p>
<ul>
<li><strong><a href="http://www.marriedgeek.com/index.php/projects/touchpointcms/">Read more about TouchPointCMS Â»</a></strong></li>
<li><strong><a href="http://www.marriedgeek.com/index.php/projects/touchpointcms/touchpointcms-demo/">Online Demo Â»</a></strong></li>
<li><strong><a href="http://www.marriedgeek.com/index.php/projects/touchpointcms/touchpointcms-gallery/">Screenshots Â»</a></strong></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/09/15/touchpointcms-beta-is-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Health Monitoring in ASP.NET</title>
		<link>http://www.marriedgeek.com/index.php/2009/08/22/health-monitoring-reporting-in-asp-net/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/08/22/health-monitoring-reporting-in-asp-net/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 17:39:32 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[ASP.NET and Web]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[custom events]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[event handlers]]></category>
		<category><![CDATA[health monitoring]]></category>
		<category><![CDATA[health reporting]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=324</guid>
		<description><![CDATA[Unless your code is perfect, you&#8217;re bound to get runtime errors. Exceptions may not get caught, connections may not get closed off, and eventually, at some point, you&#8217;ll divide by 0. While you can&#8217;t prevent them, you can be aware of them using ASP.NET&#8217;s built in health monitoring provider. Health monitoring is configured in the [...]]]></description>
			<content:encoded><![CDATA[<p>Unless your code is perfect, you&#8217;re bound to get runtime errors. Exceptions may not get caught, connections may not get closed off, and eventually, at some point, you&#8217;ll divide by 0. While you can&#8217;t prevent them, you can be aware of them using ASP.NET&#8217;s built in health monitoring provider. Health monitoring is configured in the web.config and can be set to use various types of logging, from writing to a SQL server instance or generating an email, for specific types of errors.</p>
<p>There are several pre-defined events, providers, and rules inside the root web.config file in the same directory as machine.config (not to be confused with the web.config in your application). In the <em>healthMonitoring</em> section you will see several groupings for providers, rules, profiles, and event mappings. For right now, we&#8217;ll focus on <strong>providers</strong>, <strong>rules</strong>, and <strong>eventMappings</strong>. I&#8217;ll discuss how these play into logging events.</p>
<p><strong>Providers </strong><strong>(&lt;providers&gt;)</strong> essentially tell where the log information is going. For example, the provider named <em>EventLogProvider</em> maps to the EventLogWebEventProvider class. As you&#8217;d expect, this provides all those error events you see in your Event Viewer. Similarly, the <em>SqlWebEventProvider </em>allows you to log events to the built in ASP.NET database (ASPNETDB.mdf in your app_data folder or your own SQL Server instance configured using aspnet_regsql.exe). Web can define a custom provider in your application web.config file (or in the root if you want to apply it to all your sites) to, for example, generate and send an email to a recipient containing logged event information. The <em>SimpleMailWebEventProvider</em> does just this. We will define this provider and use this provider in our example below.</p>
<p><strong>Rules</strong><strong> (&lt;rules&gt;)</strong> dictate which event type will use a provider. For example, you can have application errors write to the SQL provider or generate an email using your the email provider mentioned above. The <em>eventName</em> attribute, when adding a rule, specifies the name of the web event to use.  Basically, for each rule, you specify the eventName and the provider. Simple as that.</p>
<p><strong>Event Mappings (&lt;eventMappings&gt;) </strong>are used for mapping event names to provider classes. In the root web.config, you will notice several pre-defined provider names associated with event classes (the <em>type</em> attribute). If you are creating your own web event class (we&#8217;ll cover this in a later post), you may create a name for it and give it a type (your new class). By default, you can leave these alone, as the web events shipped with the framework cover most cases.</p>
<p>There are several event mappings listed, but there are usually one or two which, I feel, would be used in most conditions. First, the <em>All Errors</em> event mapping (using WebBaseErrorEvent) is used for all compilation, runtime, and configuration errors. I have found this to be the most handy. The second is the <em>Failure Audits</em> event (using the WebFailureAuditEvent class), which raises a an application page is accessed using improper credentials. By default, ASP.NET uses the NETWORK SERVICE account to access the file system, the registry, any databases, etc. If incorrect permissions are set in the file system, or malicious code is attempting to access the file system, this event will be raised. One other potentially useful web event is the <em>Infrastructure Error</em> mapping. This web event is raised only for compilation and configuration errors. However, I personally find it less useful, as the <em>All Errors</em> web event covers this.</p>
<p>In this post, I will create a basic health monitoring event handler using theÂ <em>SimpleMailWebEventProvider</em> class to generate an email whenever any runtime error is found on the site. The email, by default, will provide all the information I need to diagnose the error and make corrections. You may customize this email template, but that is another topic.</p>
<p>First, since we&#8217;re using an email provider, we need to configure SMTP settings in the web.config. The <em>SimpleMailWebEventProvider </em>class will use these settings for sending the email. Configure your SMTP settings as follows:</p>
<pre>&lt;configuration&gt;
    ...
    &lt;system.net&gt;
        &lt;mailSettings&gt;
            &lt;smtp deliveryMethod="Network"&gt;
                &lt;network host="<em>SERVER</em>" userName="<em>USERNAME</em>" password="<em>PASSWORD</em>" /&gt;
             &lt;/smtp&gt;
        &lt;/mailSettings&gt;
    &lt;/system.net&gt;
    ...
&lt;/configuration&gt;</pre>
<p>Once that is entered, we can begin enabling the health monitoring features and chose our provider and rules. Again, the purpose is to create an email for all site errors and send them to my email address.</p>
<pre>&lt;system.web&gt;
    ...
    &lt;healthMonitoring enabled="true"&gt;
        &lt;providers&gt;
            &lt;add name="EmailSiteErrors" type="System.Web.Management.SimpleMailWebEventProvider" to="ryan@marriedgeek.com" from="noreply@marriedgeek.com" buffer="false"/&gt;
        &lt;/providers&gt;
        &lt;rules&gt;
            &lt;add name="Email Errors" eventName="All Errors" provider="EmailSiteErrors"/&gt;
        &lt;/rules&gt;
    &lt;/healthMonitoring&gt;
    ...
&lt;/system.web&gt;</pre>
<p>That&#8217;s pretty much it. The ease of configuration and separation of providers and rules makes it a breeze to configure monitoring for your website. If you chose to use a SQL event provider, your logs will be written in the Â provider database configured in your maching.config&#8217;s connection string. You may even have both or as many provider/rule sets as you like.</p>
<p>This is an overview of how to get started with using health monitoring in ASP.NET. To read more about health monitoring, check out the following links:</p>
<ul>
<li><a href="http://forums.asp.net/t/1027461.aspx">Health Monitoring in ASP.NET 2.0</a> (forums.asp.net)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/ms178703(VS.80).aspx">ASP.NET Health Monitoring Overview</a> (msdn.microsoft.com)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/08/22/health-monitoring-reporting-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sadie Cam is live</title>
		<link>http://www.marriedgeek.com/index.php/2009/08/20/sadie-cam-is-live/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/08/20/sadie-cam-is-live/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 22:51:41 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[Everyday Stuff]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=334</guid>
		<description><![CDATA[I like to keep an eye on one of our dogs, Sadie, as I&#8217;m beginning to leave her outside of her cage. In an effort to make sure she doesn&#8217;t destroy the room, I set up the Sadie Cam, which is viewable here. The cam is usually on during work hours. Enjoy.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.marriedgeek.com/index.php/sadie-cam/"><img class="size-medium wp-image-338 alignleft" title="dogs 002" src="http://www.marriedgeek.com/wp-content/uploads/2009/08/dogs-0022-300x201.jpg" alt="dogs 002" width="300" height="201" /></a>I like to keep an eye on one of our dogs, Sadie, as I&#8217;m beginning to leave her outside of her cage. In an effort to make sure she doesn&#8217;t destroy the room, I set up the Sadie Cam, which is viewable <strong><a title="Puppy Cam" href="http://www.marriedgeek.com/index.php/sadie-cam/">here</a></strong>.</p>
<p>The cam is usually on during work hours. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/08/20/sadie-cam-is-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macbook Pro Disassembly</title>
		<link>http://www.marriedgeek.com/index.php/2009/08/07/macbook-pro-disassembly/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/08/07/macbook-pro-disassembly/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 02:22:45 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[Everyday Stuff]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=311</guid>
		<description><![CDATA[Presented by Ice-T.]]></description>
			<content:encoded><![CDATA[<p>Presented by Ice-T.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/_qWhYlhfWCI&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/_qWhYlhfWCI&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/08/07/macbook-pro-disassembly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Custom Event Handlers &amp; Arguments For Controls</title>
		<link>http://www.marriedgeek.com/index.php/2009/07/28/create-custom-event-handlers-and-arguments-controls-delegate-asp-net/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/07/28/create-custom-event-handlers-and-arguments-controls-delegate-asp-net/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 03:37:27 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[ASP.NET and Web]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[composite controls]]></category>
		<category><![CDATA[custom control]]></category>
		<category><![CDATA[custom event args]]></category>
		<category><![CDATA[delegates]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[event handlers]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=275</guid>
		<description><![CDATA[I was hoping to get this post up earlier, but got distracted by a couple of things. First, I jacked up my hand trying to separate my dogs from fighting to the point I couldn&#8217;t even move my ring finger (long story about the dogs, but I love &#8216;em). Second, I started a new job [...]]]></description>
			<content:encoded><![CDATA[<p>I was hoping to get this post up earlier, but got distracted by a couple of things. First, I jacked up my hand trying to separate my dogs from fighting to the point I couldn&#8217;t even move my ring finger (long story about the dogs, but I love &#8216;em). Second, I started a new job at <a href="http://groovecommerce.com" target="_blank">Groove Commerce</a> on Monday. So far, so good. I feel it&#8217;ll keep me on my game and give me some nice challenges ahead.</p>
<p>A few entries ago we talked about custom server controls and mentioned how to structure a composite control to allow the ViewState to &#8220;pick up&#8221; on it&#8217;s post back content so that data isn&#8217;t re-binded with every call. It was a very basic composite control, but it showed how to add native WebControl objects to the Controls tree to create a basic layout without using a .ASCX design file. This type of control can be added to your <em>app_code</em> directory or manually compiled as an assembly and placed into your <em>bin </em>directory. The advantage of the latter is to feasibly add it to your Visual Studio toolbar by loading the assembly. This time, we&#8217;ll add a custom event to our control using a delegate for an event, as well as a custom event argument class to pass along with it.</p>
<p>We&#8217;ll take the code from last time, but add several things which are highlighted in green.</p>
<ul>
<li>A line to declare our event delegate variable and the delegate itself.</li>
<li>A class which will be used for our arguments.</li>
<li>A binded event for the button Click.</li>
<li>A line in the button Click handler to invoke the event delegate.</li>
</ul>
<pre>using System;
using System.Web;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace RyanControls
{
    public class MyCompositeControl : CompositeControl
    {
        public MyCompositeControl() { }

        <span style="color: #339966;">// Declare the Updating event of delegate type CustomControlUpdateHandler</span>
        <span style="color: #339966;"><strong>public event CustomControlUpdateHandler Updating;</strong></span>

        protected override void CreateChildControls()
        {
            TextBox txtMyData = new TextBox();
            DropDownList drpMyList = new DropDownList();
            Button btnUpdate = new Button() { Text = "Update!" };

            Controls.Add(drpMyList);
            Controls.Add(txtMyData);
            Controls.Add(btnUpdate);

            if (!Page.IsPostBack)
            {
                drpMyList.Items.Add(new ListItem("item 1"));
                drpMyList.Items.Add(new ListItem("item 2"));
                drpMyList.Items.Add(new ListItem("item 3"));
            }

            <span style="color: #339966;">// Add a handler for the button click to launch the Updating event</span>
            <strong><span style="color: #339966;">btnUpdate.Click += new EventHandler(FireEvent);</span></strong>
        }
<strong>
<span style="font-weight: normal;"><span style="color: #339966;">        // The method that handles the Click event from the button
        // and triggers the Updating event by calling the delegate</span></span>
        <span style="color: #339966;">protected void FireEvent(Object s, EventArgs e)
        {</span></strong><span style="color: #339966;">
</span><strong><span style="color: #339966;">            Updating(s, new CustomControlUpdateEventArgs() { SomeData = "The control was updated!" });
        }</span>
<span style="color: #000000; font-weight: normal;">    }</span></strong><span style="color: #339966;"><span style="color: #000000;">
</span><strong>
<span style="font-weight: normal;">    // Our custom event class that inherits EventArgs. You may use
    // EventArgs as the class if you don't have additional data to pass</span></strong><strong>
    public class CustomControlUpdateEventArgs : EventArgs
    {
        public CustomControlUpdateEventArgs() { }
        public String SomeData;
    }

<span style="font-weight: normal;">    // The delegate declaration (or template, as I call it) for the handler</span></strong><strong>
    public delegate void CustomControlUpdateHandler(Object s, CustomControlUpdateEventArgs e);</strong></span>
}</pre>
<p>There you have it. If you place this code into a .CS file inside your app_code directory, you&#8217;ll be able to include the control on your pages. If you compiled it into an assembly, toss it into your <em>bin</em> directory and feel free to add it to your toolbar in VS or VWD.</p>
<pre>&lt;asp:MyCompositeControl runat="server" ID="cntMyControl" OnUpdating="DisplayUpdate" /&gt;</pre>
<p>By assigning an event handler for the Updating event (the page automatically prepends the &#8220;On&#8221; for &#8220;OnUpdating&#8221;) to call a method to handle the update, you can use data contained in the CustomControlUpdateEventArgs object. In this case, there&#8217;s only a public string called <em>SomeData</em>.</p>
<pre>protected void DisplayUpdate(Object s, RyanControls.CustomControlUpdateEventArgs e)
{
    Response.Write(String.Format("&lt;div&gt;From the event handler: {0}&lt;/div&gt;", e.SomeData));
}</pre>
<p>When you run the code and click the button, the method will be invoked and the message displayed. Similarly, you can bind the handler programmaticallyÂ by adding <em>cntMyControl.Updating += new RyanControls.CustomControlUpdateHandler(DisplayUpdate)</em> in your code-behind.</p>
<p><a href="http://www.marriedgeek.com/wp-content/uploads/2009/07/custom_event.JPG"><img class="alignright size-medium wp-image-298" title="custom_event" src="http://www.marriedgeek.com/wp-content/uploads/2009/07/custom_event-300x62.jpg" alt="custom_event" width="300" height="62" /></a></p>
<p>So again, while the code isn&#8217;t really useful, it shows how to create your own event handlers and custom argument class(es) for a composite server control. The point is to be able to create one or more event handlers, as well as combine those with one or more types of event argument classes. The fields of that particular argument class should be specific to that type of event and it is best not to use one custom event args class to satisfy many types of event argsuments, unless the data being passed into your hander functions generic enough to do so.</p>
<p>Happy coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/07/28/create-custom-event-handlers-and-arguments-controls-delegate-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Home Server How-to: Introduction</title>
		<link>http://www.marriedgeek.com/index.php/2009/07/22/home-server-how-to-introduction-series/</link>
		<comments>http://www.marriedgeek.com/index.php/2009/07/22/home-server-how-to-introduction-series/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 20:10:07 +0000</pubDate>
		<dc:creator>_theMarriedGeek</dc:creator>
				<category><![CDATA[Home Server Series]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.marriedgeek.com/?p=244</guid>
		<description><![CDATA[I&#8217;m going to begin talking a little about setting up your own home server and discuss not only some cool stuff you can do, but how to get the most use out of it. When I mention to people that I have a home server, they snicker. And that&#8217;s fine considering that the thought of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to begin talking a little about setting up your own home server and discuss not only some cool stuff you can do, but how to get the most use out of it. When I mention to people that I have a home server, they snicker. And that&#8217;s fine considering that the thought of having a server in your home usually connotates that you&#8217;re some hacker that orders pizza online and doesn&#8217;t leave the house for days. However, yes, having a some server in their house is kind of a geeky thing to do, but if used effectively, can be really beneficial to those actually using the network. All you need is a spare PC, some ethernet cable, and a spare port on your router.</p>
<p>You can do a lot with a home server. Some things may you may find more interesting depending what stuff you&#8217;re into, but here is a broad list:</p>
<ul>
<li><strong>Backups</strong> &#8211; This is by far the biggest benefit. If you&#8217;re not using automated backup software on your computers, you run the risk of a catostrophic failure (usually in the form of a dead or dying hard disk) and losing all your files. With a server, you run scheduled backups one or more times per day to grab those files off your PC or laptop and save them to your server.</li>
<li><strong>Media storage</strong> &#8211; Have a lot of music, videos, or photos? Have a spouse or kids who want access to that content? Instead of sharing one computer, store all your media on a drive connected to the server and allow for anyone to access that content any time from their own computer.</li>
<li><strong>FTP server</strong> &#8211; If you&#8217;re on the road a lot or just want access to your files, you can set up an FTP (file transfer protocol) server, allowing you to grab and/or save files to or from your server from anywhere you can steal an internet connection.</li>
<li><strong>Remote desktop</strong> &#8211; If you need to connect to the desktop of your server while you&#8217;re away, you can connect to it and view any documents or backups.</li>
<li><strong>Web server</strong> &#8211; While the first two are pretty common, running your own web server involes a bit of skill, including setup of your web application software (e.g., IIS, Apache), configuring your router and firewall, installing databases, etc. This can be a daunting task to someone new, but you can host your own websites, even your WordPress blog, from your server for free! With free DNS services out there, such as <a href="http://afraid.org" target="_blank"><strong>Afraid.org</strong></a>, as long as your ISP lets you hang onto your IP, all you have to pay for is the domain name.</li>
<li><strong>Host your own email</strong> &#8211; This one can be tricky, especially when dealing with blacklists. With free email tools out there for Windows, such as <a href="http://www.hmailserver.com/" target="_blank"><strong>hMailServer</strong></a>, you can setup POP or IMAP email for your domain. You can even run backups of your email.</li>
<li><strong>Gaming server</strong> &#8211; Yes, you can have a wicked LAN party and have your server host all the games. Ask your wife about having the party first.</li>
<li><strong>Streaming webcam</strong> &#8211; I used this idea when we got our new dog and I wanted to keep an eye on her while at work. By hooking a webcam, and using some streaming software, I was able to connect to and stream video from the camera.</li>
</ul>
<p>The concept of having a home server is pretty simple. You have a computer running 24/7 on your home network. It&#8217;s connected to your router and can talk to other machines on your network. By &#8220;talking&#8221; to other computers on your network, it simply mean that it can view their folder contents as well as allow its contents to be viewed by other computers on your network.</p>
<p>For this intro, I just wanted to cover the basics and give an overview of what a home server can do for you. For next time, I&#8217;ll discuss how to pick a computer, connect it to your network, and set up shared folders.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marriedgeek.com/index.php/2009/07/22/home-server-how-to-introduction-series/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->