<?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>Sosuke &#187; ASP.Net</title>
	<atom:link href="http://www.sosuke.com/index.php/category/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sosuke.com</link>
	<description>Dark music of the gods.</description>
	<lastBuildDate>Wed, 06 Jan 2010 01:34:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Blocking IP addresses by country on IIS shared hosting</title>
		<link>http://www.sosuke.com/index.php/2009/05/20/blocking-ip-addresses-by-country-on-iis-shared-hosting/</link>
		<comments>http://www.sosuke.com/index.php/2009/05/20/blocking-ip-addresses-by-country-on-iis-shared-hosting/#comments</comments>
		<pubDate>Thu, 21 May 2009 06:23:08 +0000</pubDate>
		<dc:creator>sosuke</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[shared hosting]]></category>

		<guid isPermaLink="false">http://www.sosuke.com/?p=32</guid>
		<description><![CDATA[On a shared hosting environment you often won&#8217;t have access to ban IP addresses on the IIS level and my shared host didn&#8217;t offer the Firewall module for Plesk so I had to come up with a programmatic way of blocking large blocks of IPs. You can setup in your web.config file something called a [...]]]></description>
			<content:encoded><![CDATA[<p>On a shared hosting environment you often won&#8217;t have access to ban IP addresses on the IIS level and my shared host didn&#8217;t offer the Firewall module for Plesk so I had to come up with a programmatic way of blocking large blocks of IPs. You can setup in your web.config file something called a HTTPModule that works before the page is delivered to the client computer. For this sample I added a key and value to my web.config file that holds my comma separated IP list that I want to block. Since I&#8217;m running a site that is focused on the United States there isn&#8217;t much overlap on the /24 block area 255.255.255.* so I am only checking the first 3 digit blocks for matches. When a request comes in IpTwentyFourBlockingModule will check the users IP address against the key value blockiptwentyfour to see if there is a match and if it is a match will return 403 forbidden to the client browser, banned! </p>
<p>Coming up with a IP list is another problem. I found <a href="http://iplocationtools.com">IP Location Tools</a> that gives out an API that generates a updated <a href="http://iplocationtools.com/ip_country_block_iptables.php">list of IPs for a given country</a>. The problem is the list gets broken out into IP blocks other than /24, you&#8217;ll see all ranges of IP blocks that get very complicated very fast and more than I wanted to try and pull off in a days work. I wrote a Flash ActionScript 3 application to consume this data and give me a list of unique IPs 255.255.255 that I could then drop in as the value for blockiptwentyfour. I then added IP tracking for new users and have had to ban some rogue /24 blocks that escaped this list but its kept them at bay and more manageable for now. I&#8217;ve already had a colleague suggest that this is still only a stopgap at best and I should develop some kind of throttling system to help prevent spam when I&#8217;m not around to watch the site like a hawk.</p>
<p>web.config</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;appSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;blockiptwentyfour&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;41.210.29,41.210.28&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/appSettings<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;httpModules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;IpTwentyFourBlockingModule&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;IpTwentyFourBlockingModule&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/httpModules<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.web<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>IpTwentyFourBlockingModule.cs &#8211; put this is in your App_Code</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080;">#region Using</span>
&nbsp;
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Configuration</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Specialized</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080;">#endregion</span>
&nbsp;
<span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
<span style="color: #008080; font-style: italic;">/// Block the response to certain IP addresses</span>
<span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> IpTwentyFourBlockingModule <span style="color: #008000;">:</span> IHttpModule
<span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #008080;">#region IHttpModule Members</span>
&nbsp;
    <span style="color: #0600FF;">void</span> IHttpModule.<span style="color: #0000FF;">Dispose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">// Nothing to dispose; </span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF;">void</span> IHttpModule.<span style="color: #0000FF;">Init</span><span style="color: #000000;">&#40;</span>HttpApplication context<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        context.<span style="color: #0000FF;">BeginRequest</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #000000;">&#40;</span>context_BeginRequest<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #008080;">#endregion</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Checks the requesting IP address in the collection</span>
    <span style="color: #008080; font-style: italic;">/// and block the response if it's on the list.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> context_BeginRequest<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> sender, EventArgs e<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> ip <span style="color: #008000;">=</span> HttpContext.<span style="color: #0000FF;">Current</span>.<span style="color: #0000FF;">Request</span>.<span style="color: #0000FF;">UserHostAddress</span><span style="color: #008000;">;</span>
        <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> tempIpArray <span style="color: #008000;">=</span> ip.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">'.'</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #FF0000;">string</span> iptwentyfour <span style="color: #008000;">=</span> tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;.&quot;</span> <span style="color: #008000;">+</span> tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>_IpAdresses.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span>iptwentyfour<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            HttpContext.<span style="color: #0000FF;">Current</span>.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">StatusCode</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">403</span><span style="color: #008000;">;</span>
            HttpContext.<span style="color: #0000FF;">Current</span>.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> StringCollection _IpAdresses <span style="color: #008000;">=</span> FillBlockedIps<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">/// &lt;summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// Retrieves the IP addresses from the web.config</span>
    <span style="color: #008080; font-style: italic;">/// and adds them to a StringCollection.</span>
    <span style="color: #008080; font-style: italic;">/// &lt;/summary&gt;</span>
    <span style="color: #008080; font-style: italic;">/// &lt;returns&gt;A StringCollection of IP addresses.&lt;/returns&gt;</span>
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> StringCollection FillBlockedIps<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        StringCollection col <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> StringCollection<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #FF0000;">string</span> raw <span style="color: #008000;">=</span> ConfigurationManager.<span style="color: #0000FF;">AppSettings</span>.<span style="color: #0000FF;">Get</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;blockiptwentyfour&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> ip <span style="color: #0600FF;">in</span> raw.<span style="color: #0000FF;">Split</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">','</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            col.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span>ip.<span style="color: #0000FF;">Trim</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">return</span> col<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>collectipaddresses.as</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.events</span>.<span style="color: #000000; font-weight: bold;">*</span>;
<span style="color: #0033ff; font-weight: bold;">import</span> <span style="color: #004993;">flash.net</span>.<span style="color: #000000; font-weight: bold;">*</span>;
&nbsp;
<span style="color: #6699cc; font-weight: bold;">var</span> myRequest<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLRequest</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLRequest</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;http://iplocationtools.com/country_query.php?country=CI,SN,GH,NA,NG&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #004993;">loader</span>.<span style="color: #004993;">dataFormat</span> = <span style="color: #004993;">URLLoaderDataFormat</span>.<span style="color: #004993;">TEXT</span>;
<span style="color: #004993;">loader</span>.<span style="color: #004993;">addEventListener</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">Event</span>.<span style="color: #004993;">COMPLETE</span>, handleComplete<span style="color: #000000;">&#41;</span>;
<span style="color: #004993;">loader</span>.<span style="color: #004993;">load</span><span style="color: #000000;">&#40;</span>myRequest<span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> handleComplete<span style="color: #000000;">&#40;</span>event<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Event</span><span style="color: #000000;">&#41;</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #0033ff; font-weight: bold;">void</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> <span style="color: #004993;">loader</span><span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">URLLoader</span> = <span style="color: #004993;">URLLoader</span><span style="color: #000000;">&#40;</span>event.<span style="color: #004993;">target</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #009900;">//trace(loader.data.replace(/\n/g, &quot;|&quot;));</span>
	<span style="color: #6699cc; font-weight: bold;">var</span> ipArray<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #004993;">loader</span>.<span style="color: #004993;">data</span>.<span style="color: #004993;">replace</span><span style="color: #000000;">&#40;</span><span style="color: #000000; font-weight: bold;">/</span>\n<span style="color: #000000; font-weight: bold;">/</span>g, <span style="color: #990000;">&quot;|&quot;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;|&quot;</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>ipArray.<span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span>;
	setTwentyFourBlock<span style="color: #000000;">&#40;</span>ipArray<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #339966; font-weight: bold;">function</span> setTwentyFourBlock<span style="color: #000000;">&#40;</span>ipArray<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #6699cc; font-weight: bold;">var</span>	shortIpArray<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Array</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
	<span style="color: #6699cc; font-weight: bold;">var</span>	lastUniqueIp<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;&quot;</span>;
&nbsp;
	<span style="color: #0033ff; font-weight: bold;">for</span> <span style="color: #0033ff; font-weight: bold;">each</span><span style="color: #000000;">&#40;</span><span style="color: #6699cc; font-weight: bold;">var</span> ip<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> <span style="color: #0033ff; font-weight: bold;">in</span> ipArray<span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #6699cc; font-weight: bold;">var</span> tempIpArray<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">Array</span> = ip.<span style="color: #004993;">split</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">&quot;.&quot;</span><span style="color: #000000;">&#41;</span>;
		<span style="color: #6699cc; font-weight: bold;">var</span> stringCurrentIp<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">+</span>tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">+</span>tempIpArray<span style="color: #000000;">&#91;</span><span style="color: #000000; font-weight:bold;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000; font-weight: bold;">+</span><span style="color: #990000;">&quot;.0&quot;</span>;
		<span style="color: #0033ff; font-weight: bold;">if</span><span style="color: #000000;">&#40;</span>stringCurrentIp <span style="color: #000000; font-weight: bold;">!</span>= lastUniqueIp<span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			lastUniqueIp = stringCurrentIp;
			shortIpArray.<span style="color: #004993;">push</span><span style="color: #000000;">&#40;</span>stringCurrentIp<span style="color: #000000;">&#41;</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
&nbsp;
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>shortIpArray.<span style="color: #004993;">length</span><span style="color: #000000;">&#41;</span>;
	<span style="color: #004993;">trace</span><span style="color: #000000;">&#40;</span>shortIpArray.<span style="color: #004993;">join</span><span style="color: #000000;">&#40;</span><span style="color: #990000;">','</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>All of this work has really kept my <a href="http://www.diveintothepool.com/">free online dating</a> site almost spam free for now but I&#8217;m adding IP blocks I&#8217;ve missed from time to time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sosuke.com/index.php/2009/05/20/blocking-ip-addresses-by-country-on-iis-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validation of viewstate MAC failed.</title>
		<link>http://www.sosuke.com/index.php/2009/05/12/validation-of-viewstate-mac-failed/</link>
		<comments>http://www.sosuke.com/index.php/2009/05/12/validation-of-viewstate-mac-failed/#comments</comments>
		<pubDate>Wed, 13 May 2009 05:33:29 +0000</pubDate>
		<dc:creator>sosuke</dc:creator>
				<category><![CDATA[ASP.Net]]></category>

		<guid isPermaLink="false">http://www.sosuke.com/?p=27</guid>
		<description><![CDATA[A very popular error, so popular and in so many places still unresolved. I spent a while trying to track down what was causing this error on my new hosting environment. I felt it would be a great idea to go ahead and repost my successful solution. I first did a hefty bit of searching [...]]]></description>
			<content:encoded><![CDATA[<p>A very popular error, so popular and in so many places still unresolved. I spent a while trying to track down what was causing this error on my new hosting environment. I felt it would be a great idea to go ahead and repost my successful solution. I first did a hefty bit of searching on Google of course. Going through dozens of blogs and forums that seemed to all have similar answers for how to solve it. Turn off event validation they would say! Everything I read on that was telling me it would be a security nightmare to have a public application with page validateRequest=&#8221;false&#8221; enableEventValidation=&#8221;false&#8221; viewStateEncryptionMode=&#8221;never&#8221; in your web config file. I tried it anyway and I still got &#8220;Validation of viewstate MAC failed.&#8221; and I was so frustrated!</p>
<p>I kept searching until I found <a href="http://www.developmentnow.com/articles/machinekey_generator.aspx">http://www.developmentnow.com/articles/machinekey_generator.aspx</a> that generated a machine key and the xml required for my web config file. I put that in there an set the page attribute enableViewStateMac to true and uploaded my changes. I waited, 5 minutes no error, 5 hours no error, 24 hours no error. I exclaimed with joy when I could refresh my <a href="http://www.diveintothepool.com/SearchProfiles.aspx">free online dating search</a> page after being idle a while and not see that terrible error. I hope this helps out someone else as I spent way to long tracking down an answer to this problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sosuke.com/index.php/2009/05/12/validation-of-viewstate-mac-failed/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>DiveIntoThePool.com free online dating site launched!</title>
		<link>http://www.sosuke.com/index.php/2009/05/12/diveintothepoolcom-free-online-dating-site-launched/</link>
		<comments>http://www.sosuke.com/index.php/2009/05/12/diveintothepoolcom-free-online-dating-site-launched/#comments</comments>
		<pubDate>Wed, 13 May 2009 05:16:00 +0000</pubDate>
		<dc:creator>sosuke</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.sosuke.com/?p=25</guid>
		<description><![CDATA[This main page is practically a launch announcement site at this point. It&#8217;s been a long hard road to launching DiveIntoThePool.com and I&#8217;ve so far met all my goals I set out to when beginning development on the site. It was in a language I&#8217;ve never used, ASP.Net in C#. On a platform I didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>This main page is practically a launch announcement site at this point. It&#8217;s been a long hard road to launching <a title="free online dating" href="http://diveintothepool.com">DiveIntoThePool.com</a> and I&#8217;ve so far met all my goals I set out to when beginning development on the site. It was in a language I&#8217;ve never used, ASP.Net in C#. On a platform I didn&#8217;t know, Windows and IIS hosting. It gave me more experience in designing database driven applications and I started completely fresh on MSSQL as well. It&#8217;s been over a year and a half since I started this and I feel so great having designed, developed, managed and launched this project finally. Now the fun begins. From here on in I&#8217;ve got to use everything I know about SEO and marketing techniques to promote my new website as I refuse to let it become dormant as I&#8217;ve seen so many dating sites do. I&#8217;ve setup a <a href="http://diveintothepool.wordpress.com">blog</a> for the site as well to talk about things that are specific to that project. You can follow the project on <a href="http://twitter.com/freedateonline">twitter</a>, <a href="http://www.facebook.com/pages/DiveIntoThePoolcom-100-FREE-Online-Dating/80266327361">Facebook</a> or <a href="http://www.myspace.com/467866004">MySpace</a> too! Let me know what you think of the new site or if you create a profile!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sosuke.com/index.php/2009/05/12/diveintothepoolcom-free-online-dating-site-launched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
