代码之家  ›  专栏  ›  技术社区  ›  Cody C

Facebook标记语言和.NET MVC 2.0

  •  0
  • Cody C  · 技术社区  · 14 年前

    我正在使用FBML创建一个.NETMVC(1.0)facebook应用程序。一切都如期而至。但是,如果我只是将项目更改为引用System.Web.Mvc 2.0程序集,则应用程序将停止工作。没有抛出异常(通过控制器类就可以了),但是页面上什么都没有呈现?有什么想法吗?

    编辑2:如果我去掉所有的FBML,我仍然没有任何渲染。现在我把它简化为以下内容。同样,当我引用Mvc 1.0程序集时,这也非常有用

    索引.aspx

    <%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
    <asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    Inside Index
     </asp:Content>
    

    站点.主

    <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
    Master Page
    

    [FacebookAuthorization(IsFbml = true)] 
    public ActionResult Index()
    {
      var api = this.GetApi();
      ViewData["userId"] = api.Session.UserId;
      return View();
    }
    
    1 回复  |  直到 14 年前
        1
  •  0
  •   Community CDub    8 年前

    您需要在web.config文件中添加程序集绑定。见 this 询问详情。