如何在MVC.Net中制作管理面板? [英] How to make Admin Panel in MVC.Net?

查看:100
本文介绍了如何在MVC.Net中制作管理面板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用区域"在ASP.NET MVC项目中实现管理面板 但我对此一无所知.

I want to implement an admin panel in my ASP.NET MVC Project using "Areas" but I don't have any idea about this.

请告诉我如何使用Controllers或Areas在ASP.NET MVC项目中实现管理面板.

Please tell me how to implement an admin panel in an ASP.NET MVC Project, either using Controllers or Areas.

实际上,我正在为诊所实施ASP.NET MVC项目,客户希望通过管理面板处理所有活动.我是初学者,正在做ASP.NET MVC.

Actually I am implementing an ASP.NET MVC Project for a clinic and the client wants to handle all activity through an admin panel. I am beginner doing ASP.NET MVC.

有人知道该怎么做吗?您能为我提供一些有关如何在ASP.NET中实现它的提示吗?

Does anyone know how to do this? Can you please provide me with some tips on how to implement it in ASP.NET?

推荐答案

首先

ASP.NET MVC中的区域用于将逻辑相关的部分组合在一起.通过创建区域,您将在/Area文件夹中获得单独的/Contoller/Views/Model文件夹以及配置文件.您还必须为此配置路由.

First of all

Areas in ASP.NET MVC are used to group logically related parts together. By creating an area you'll get separate /Contoller, /Views and /Model folders and config file inside the /Area folder. You'll further have to configure routes for that.

我建议您首先在默认的Intranet应用程序中创建一个简单区域. 这里是一个简短的教程 .

I would recommend you to first create a simple area in your default intranet application. Here is a short tutorial on how to do it.

现在,一旦您解决了区域问题,那么您可能想要继续创建管理面板.我从您的管理面板"一词了解到,您希望针对数据库中每个表的页面执行 CRUD 操作.

Now once you have area problem solved then you would probably want to proceed to create admin panel. What I understand from your word "admin panel" is that you want a page against every table in your database to perform CRUD operations on them.

在这里,您需要阅读有关如何使用ASP.NET MVC连接到数据库的ASP.NET MVC的基础知识.提示: dbContext .

Here you'll need to read the basics of ASP.NET MVC on how to connect to database using ASP.NET MVC. Hint: dbContext.

/Models文件夹中为您的表创建一个模型. 添加/Controller文件夹中的="=" nofollow noreferrer>控制器.默认情况下,将有一个动作.您可以更改其名称或创建新名称.

Create a model for you table in /Models folder. Add a Controller in your /Controller folder. By default there will be an action. You can change its name or create new one.

您可以创建

You can create your Views from scaffolding by right-clicking action name in your controller, here you will have be shown models list to select model for these views, Select the model you created in your /Model folder.

此外,我建议您阅读一本书或一些有关ASP.NET MVC的视频讲座(Scott Allen的讲座对基本理解非常好),并查找管理面板的工作方式以及从头开始创建它们的最佳方法是什么

Further I will recommend you grab a book or some video lectures (Scott allen's lecture are pretty good for basic understanding) on ASP.NET MVC and also look for how the admin panels work and what's the best way to create them from scratch.

这篇关于如何在MVC.Net中制作管理面板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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