Note that there are some explanatory texts on larger screens.

plurals
  1. POProblem to redirect the user to startpage
    text
    copied!<p>I have read many threads about this, but i haven't found a solution that works.</p> <p>I have problem with the Facebook C# SDK. I can't redirect the user to the startpage. I think there is a problem with facebookredirect.axd. Whats that? Way can't i send the user to the startpage for my app? When i enter the startpage for my facebook app, i will be redirected to the permission page, and when i accept the permission, i will be redirected to the startpage of facebook (www.facebook.com). Why? Why not to my app?</p> <p>This is the url on the permission page: <a href="http://www.facebook.com/connect/uiserver.php?app_id=" rel="nofollow">http://www.facebook.com/connect/uiserver.php?app_id=</a>&amp;method=permissions.request&amp;display=page&amp;next=http%3A%2F%2Flocalhost%3A2143%2Ffacebookredirect.axd&amp;response_type=code&amp;state=eyJyIjoiaHR0cDovL2FwcHMuZmFjZWJvb2suY29tL2Jhcm5kYWdib2tlbi9EZWZhdWx0LmFzcHgifQ&amp;fbconnect=1&amp;perms=email</p> <p>If i manually change facebookredirect.axd to facebookredirect.axd/Default.aspx (in the url) it's work, but must the visitors do that?</p> <p>This is a bit of my web.config: </p> <pre><code>&lt;configSections&gt; &lt;section type="Facebook.FacebookConfigurationSection, Facebook" name="facebookSettings" allowLocation="true" allowDefinition="Everywhere" /&gt; &lt;section name="canvasSettings" type="Facebook.Web.CanvasConfigurationSettings, Facebook.Web" /&gt; &lt;/configSections&gt; &lt;facebookSettings canvasPage = "http://apps.facebook.com/&lt;APPNAME&gt;/" secureCanvasUrl="http://localhost:2143/" canvasUrl="http://localhost:2143/" appSecret="" appId="" cancelUrlPath = "" /&gt; &lt;canvasSettings canvasUrl="http://localhost:2143/" canvasPageUrl="http://apps.facebook.com/&lt;APPNAME&gt;/" authorizeCancelUrl="http://facebook.com"/&gt; &lt;httpHandlers&gt; &lt;add verb="*" path="/" type="System.Web.UI.Page"/&gt; &lt;add verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /&gt; &lt;/httpHandlers&gt; &lt;handlers&gt; &lt;add name="facebookredirect.axd" verb="*" path="facebookredirect.axd" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /&gt; &lt;/handlers&gt; </code></pre> <p>I have create a map with name facebookredirect.axd and ádd a web.config file in it with this:</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;configuration&gt; &lt;system.web&gt; &lt;httpHandlers&gt; &lt;clear/&gt; &lt;add path="*" verb="*" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /&gt; &lt;/httpHandlers&gt; &lt;/system.web&gt; &lt;system.webServer&gt; &lt;handlers&gt; &lt;clear/&gt; &lt;add name="facebookredirect" path="*" verb="*" type="Facebook.Web.FacebookAppRedirectHttpHandler, Facebook.Web" /&gt; &lt;/handlers&gt; &lt;/system.webServer&gt; &lt;/configuration&gt; </code></pre> <p>On the startpage (Default.aspx) i have this:</p> <pre><code> CanvasAuthorizer auth = new CanvasAuthorizer { Permissions = new[] { "email" } }; if (auth.Authorize()) { FacebookWebClient client = new FacebookWebClient(); dynamic parameters = new ExpandoObject(); parameters.fields = "id, name, third_party_id, username"; dynamic result = client.Get("me", parameters); } </code></pre> <p>When i build this site with Facebook javascript sdk its worked perfect, and now when i try the Facebook C# SDK the page is "broken"....</p> <p>What have i done wrong?</p> <p>Grateful for any help!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload