错误:可访问性不一致 [英] Error: Inconsistent accessibility

查看:139
本文介绍了错误:可访问性不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在应用程序中使用以下控制器,当我单击构建应用程序时,它为我提供了

I am using following controller in my apllication and when i click on build application it gives me the

Error:Inconsistent accessibility: parameter type 'LoginControl.Controllers.LoginModel' is less accessible than method 'LoginControl.Controllers.LoginController.Index(LoginControl.Controllers.LoginModel)'


namespace LoginControl.Controllers
{
    public class LoginController : Controller
    {
       
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost]
        public ActionResult Index(LoginModel model)
        {
            return View();
        }
    }
}


请告诉我解决方案.
在此先谢谢您


Tell Me the solution please.
Thank you in advance

推荐答案

在您的代码Loginmethod类中可能是:

类Loginmethod
{
}
它应该是公开可见的,例如:

公共类Loginmethod
{

}


请备注/回复....


Kaushik
in your Code Loginmethod Class may be:

class Loginmethod
{
}
it should be Public Viewable like :

public class Loginmethod
{

}


Please Remark/Reply....


Kaushik


根据我的主要猜测,"LoginModel"应该是公开的.您尚未发布LoginModel的代码
As per my primary guess "LoginModel" should be public.. You have not posted the code for LoginModel


这篇关于错误:可访问性不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆