使用visual studio 2008的ASP.NET3.5 MVC2网站应用程序 [英] ASP.NET3.5 MVC2 website application using visual studio 2008

查看:86
本文介绍了使用visual studio 2008的ASP.NET3.5 MVC2网站应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ASP.NET MVC2网站应用程序开发的新手。在这里寻找一些指导。三个问题:

环境:使用Visual Studio 2008的ASP.NET 3.5 MVC2网站。



1.我正在建设的网站是' Intranet'和更像是文档存储库。(没有找到文档存储,检索过程的最佳方法)

2.应该使用Windows身份验证。(想通了)

3.多级左侧和顶部导航菜单。(没有想出最好的方法,尝试下载jquery模板,但没有一个适用于上面的环境,请建议任何兼容的jquery模板)。

4. MVC2方法是否能够使用webparts基于代码隐藏中定义的Windows登录/权限来控制/编辑网站上的内容?



请建议使用#1和#3,对于#2,您认为MVC2是最佳选择还是应该采用基于Web表单的网站开发以及环境约束。



谢谢!

-MT

Hi, I am new to the ASP.NET MVC2 website applications development. Looking for some guidance here. Top three questions:
Environment: ASP.NET 3.5 MVC2 website using Visual Studio 2008.

1. Website that i am building is 'Intranet' and more like a document repository at the moment.(not figured out the best approach for document storage,retrieval process)
2. Should be utilizing windows authentication.(Figured out)
3. Multi level left and top navigation menu.(Not figured out the best approach, tried downloading the jquery templates but none worked with the environment above, please suggest any compatible jquery templates).
4. Does MVC2 approach provide ability to control/edit the content on the website using webparts based on windows login/permissions defined on code-behind?

Please suggest for #1 and #3, and for #2 do you think MVC2 is best choice or should go with web form based website development with the constraints in environment.

Thank you!
-MT

解决方案

0)不要住在过去。切换到MVC4,如果你无法将VS的完整版本升级到2012,只需下载 Web Developer Express版本 [ ^ ],我很确定,这对你来说已经足够了。

1)使用实体框架 [ ^ ]为DAL + BL。

2)如果您需要管理多个和大型文件,最好使用 FILESTREAM [ ^ ] SQL服务器的功能而不是BLOB( varbinary(max)),这是一个如何与EF集成的示例: http:// blogs。 microsoft.co.il/blogs/bursteg/archive/2008/05/12/ado-net-entity-framework-support-filestream.aspx [ ^ ]

3)在 MVC [ ^ ],主要由 IIS [< a href =http://technet.microsoft.com/en-us/library/cc754628(v=ws.10).aspxtarget =_ blanktitle =New Window> ^ ]本身但是授权可能会更复杂,特别是在域环境中。

4)Jquery是一种很好的导航方法,但是使用你的环境比使用jquery更好地继续前进。

5)webparts不是mvc概念。您可以控制任何内容,您可以完全控制发出的HTML代码,而不是Web表单。但编辑文档的可能性实际上取决于文档格式。所以没有单一的答案。

6)你可以在这里看看用MVC实现的一些CMS: http://www.codeplex.com/site/search?query=mvc%20cms&ac=4 [ ^ ]
0) Don't live in the past. Switch to MVC4, and if you can't upgrade a full blown version of VS to 2012, just download a Web Developer Express edition[^], I am pretty sure, it will be enough for you for the start.
1) Use entity framework[^] as "DAL+BL".
2) If you need to manage multiple and large files, you better use the FILESTREAM[^] functionality of SQL server instead of BLOBs (varbinary(max)), here is an example how to integrate with EF: http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/05/12/ado-net-entity-framework-support-filestream.aspx[^]
3) Windows authentication is quite straightforward in MVC[^], mostly managed by IIS[^] itself, but authorization might be more complicated, especially in a domain environment.
4) Jquery is a good approach to the navigation, but better step forward with your environment than step back with jquery.
5) "webparts" are not mvc concepts. You can control anything, you have full control over the emitted html code, more than with web forms. But the possibility of editing the document is really dependent on the document format. So there is no single answer to this.
6) You might look around here to see some CMS implemented with MVC: http://www.codeplex.com/site/search?query=mvc%20cms&ac=4[^]


To help使用#4,在我编写的MVC 4内部网应用程序中,我设置控制器方法以限制基于角色的访问。



例如:只有管理员才能从这种索引方法中获得一个视图:

To help with your #4, in an MVC 4 intranet app i wrote, i setup the controller methods to restrict access based on roles.

Ex: Only administrators can get a view from this index method:
[Authorize(Roles="Administrators")]
        public ActionResult Index()
        {





这将让人们访问他们不应该的东西



我也在我的视图中添加这样的菜单来控制谁会看到什么。



This will keep people for accessing things they shouldn't

I also add something like this to menus in my views to control who will see what.

@if(Roles.IsUserInRole("Administrators"))
  {<ul><li>@Html.ActionLink("Click Here", "Index", "HomeController")</li></ul>}



只有管理员才能获得指向索引视图的点击此处链接家庭控制器。



我希望这可以帮助你开始。祝你好运!


Only administrators will be offered a "Click Here" link to the Index view in the Home Controller.

I hope that helps you to get started. Good luck!


这篇关于使用visual studio 2008的ASP.NET3.5 MVC2网站应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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