开发者

How to implement Facebook namespace into my MVC 3 application?

开发者 https://www.devze.com 2023-03-08 13:41 出处:网络
I\'ve got an MVC 3 application I\'m trying to use Facebook authentication on, but for whatever reason the namespace isn\'t being recognized in my app.

I've got an MVC 3 application I'm trying to use Facebook authentication on, but for whatever reason the namespace isn't being recognized in my app.

In my _Layout.cshtml file (master page for MVC 3), I put:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 

Then in my home Index:

<script src="http://static.ak.connect.facebook.co开发者_如何学Gom/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

    <p>
        <fb:login-button v="2" size="medium" onlogin="window.location.reload(true);">My Facebook Account</fb:login-button>
    </p>

When the page renders, it shows the My Facebook Account text, but no button!

Visual Studio is also complaining that "fb is an unrecognized namespace"...

Are the namespaces passed down to the views? Why is "fb" not being recognized, even if it's in the _Layout.cshtml?

0

精彩评论

暂无评论...
验证码 换一张
取 消