【发布时间】:2012-02-16 14:46:32
【问题描述】:
将我的 MVC 3 Web 应用程序发布到我的网站时,我收到一条错误消息,指出未将对象引用设置为对象的实例。
“错误”行是:
第 2 行:ViewBag.Title = "Index";
这是我的索引视图:
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
这是我的家庭控制器:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace WebApplication.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
}
}
我已经上传了 DLL:
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
感谢您的帮助
【问题讨论】:
标签: asp.net-mvc null viewbag