<?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 jackol's den &#187; asp.net</title>
	<atom:link href="http://www.thejackol.com/tag/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thejackol.com</link>
	<description>01100010 01101100 01100101 01101000</description>
	<lastBuildDate>Wed, 28 Dec 2011 03:40:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Prevent One Click Attacks by setting ViewStateUserKey in ASP.NET applications</title>
		<link>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/</link>
		<comments>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/#comments</comments>
		<pubDate>Sun, 13 Sep 2009 20:11:08 +0000</pubDate>
		<dc:creator>Mikhail Esteves</dc:creator>
				<category><![CDATA[C#/.NET]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://www.thejackol.com/?p=633</guid>
		<description><![CDATA[Here&#8217;s an easy way to avoid One Click Attacks in ASP.NET applications. If you have a Base class that all your ASP.NET pages derive from, override the OnInit function. For example: protected override void OnInit(EventArgs e) { base.OnInit(e); if (User.Identity.IsAuthenticated) ViewStateUserKey = User.Identity.Name; } If you don&#8217;t have a base class defined, you would have [...]]]></description>
			<content:encoded><![CDATA[	<p>Here&#8217;s an easy way to avoid <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">One Click Attacks</a> in <span class="caps">ASP</span>.<span class="caps">NET</span> applications. If you have a Base class that all your <span class="caps">ASP</span>.<span class="caps">NET</span> pages derive from, override the <code>OnInit</code> function. For example:</p>

<pre><code>protected override void OnInit(EventArgs e)
{
    base.OnInit(e);
</code>
<code>    if (User.Identity.IsAuthenticated)
        ViewStateUserKey = User.Identity.Name;
}
</code></pre>

	<p>If you don&#8217;t have a base class defined, you would have to put the above code in every <span class="caps">ASP</span>.<span class="caps">NET</span> page.</p>]]></content:encoded>
			<wfw:commentRss>http://www.thejackol.com/2009/09/14/prevent-one-click-attacks-by-setting-viewstateuserkey-in-asp-net-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

