<?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>ON Blog &#187; ASP.NET</title>
	<atom:link href="http://onishimura.com/category/asp-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://onishimura.com</link>
	<description></description>
	<lastBuildDate>Sat, 21 May 2011 17:23:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Facebook C# &#8211; Sample ASP.NET application and access tokens</title>
		<link>http://onishimura.com/2010/07/19/8-facebook-c-sample-asp-net-application-and-access-tokens/</link>
		<comments>http://onishimura.com/2010/07/19/8-facebook-c-sample-asp-net-application-and-access-tokens/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 08:05:58 +0000</pubDate>
		<dc:creator>onishimura</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Facebook]]></category>

		<guid isPermaLink="false">http://onishimura.com/?p=116</guid>
		<description><![CDATA[Put together another quick sample app, this time for ASP.NET 4.0, instead of MVC. I&#8217;ve also added an example of how to post to a user&#8217;s wall, using the Facebook [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fonishimura.com%2F2010%2F07%2F19%2F8-facebook-c-sample-asp-net-application-and-access-tokens%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fonishimura.com%2F2010%2F07%2F19%2F8-facebook-c-sample-asp-net-application-and-access-tokens%2F&amp;style=normal&amp;service=bit.ly&amp;service_api=R_354251666833c9af8376ce38ad1460f1&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Put together another quick sample app, this time for ASP.NET 4.0, instead of MVC.<br />
I&#8217;ve also added an example of how to post to a user&#8217;s wall, using the <a href='http://github.com/facebook/csharp-sdk'>Facebook C# SDK</a></p>
<p><img src='http://onishimura.s3.amazonaws.com/fb-aspnet.png' alt='Facebook ASPNET Sample'  width='500px' height='259px' /></p>
<p><span id="more-116"></span><br />
As I mentioned earlier, the facebookconnect class included is just a helper class I used to pull values out of the fbs_[appid] cookie. You can get the access_token out of the cookie directly if you want using something like the following:</p>
<p>string accessToken = HttpContext.Current.Request.Cookies["fbs_" + ConfigurationManager.AppSettings["AppID"]]["\"access_token"];</p>
<p>Assuming you have AppID as an appsetting in your web.config. Also, as usual you should change the app id in the sample project to match whatever your current app is using.</p>
<p><a href='http://onishimura.s3.amazonaws.com/code/FacebookSampleASPNETApp.zip'>Download the code here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://onishimura.com/2010/07/19/8-facebook-c-sample-asp-net-application-and-access-tokens/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

