0
public class UserController : Controller
{
//
// GET: /User/
public ActionResult Register()
{
return View();
}
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Register(User U)
{
if (ModelState.IsValid)
{
using (MyDatabaseEntities dc = new MyDatabaseEntities())
{
dc.Users.Add(U);
dc.SaveChanges();
ModelState.Clear();
U = null;
ViewBag.Message = "Successfully register Done";
}
}
return View(U);
}
}
不一致的可訪問性:參數類型''Register.controllers.User'比方法'UserController.register(RegisterFrom.Controllers.User)'更難以訪問......這是實際的錯誤 – 2014-11-24 11:40:56