Tôi có một bản cài đặt mới của umbraco 4.11.3 Tôi đang cố gắng thực hiện một kiểm tra điều khiển đơn giản, nhưng điều gì đó đã khiến tôi khó chịu. Tôi đã tạo một Loại tài liệu "Demo" không có mẫu phù hợp. Sau đó, một mục nội dung được gọi là "Demo" dựa trên loại tài liệu đó và thay đổi thiết lập cấu hình này (defaultRenderingEngine -> MVC) Tôi đã thêm một bộ điều khiển mới với mã bên dưới.Umbraco 4.11.3 - Yêu cầu hiện tại về loại bộ điều khiển là mơ hồ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Umbraco.Web.Models;
namespace FrontEnd.Controllers
{
public class DemoController : Umbraco.Web.Mvc.RenderMvcController
{
//
// GET: /Demo/
public ActionResult Index(RenderModel model)
{
return base.Index(model);
}
public ActionResult Demo(RenderModel model)
{
return View(model);
}
}
}
tôi nhận được lỗi này:
The current request for action 'Index' on controller type 'DemoController' is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type FrontEnd.Controllers.DemoController
System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Umbraco.Web.Mvc.RenderMvcController
Exception Details: System.Reflection.AmbiguousMatchException: The current request for action 'Index' on controller type 'DemoController'
is ambiguous between the following action methods:
System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type FrontEnd.Controllers.DemoController
System.Web.Mvc.ActionResult Index(Umbraco.Web.Models.RenderModel) on type Umbraco.Web.Mvc.RenderMvcController
Bất kỳ ý tưởng về nơi để làm cho ở đây?
Cảm ơn
oops - xấu của tôi. quên ghi đè lên phương thức hành động Index. Hoạt động ngay bây giờ. – MikeW
Cân nhắc trả lời câu hỏi của riêng bạn và sau đó đánh dấu câu hỏi đó làm câu trả lời. –