简体   繁体   English

用EF和ASP.NET控件构建成员页面的最佳方法?

[英]Best way to build member pages with EF and ASP.NET controls?

I'm trying to build a website that has a Member section, and I'm struggling to find a fast and efficient way to build the enduser pages, which will pull a user's data. 我正在尝试建立一个具有“会员”部分的网站,而我正努力寻找一种快速有效的方法来构建最终用户页面,该页面将提取用户的数据。

For example, the user's "my account" page. 例如,用户的“我的帐户”页面。 They simply need to be able to view and edit the data. 他们只需要能够查看和编辑数据。 Would you use the Entity Frameworks EntityDataSource control? 您将使用Entity Frameworks EntityDataSource控件吗? And bind it to a FormView, DetailsView, or ListView? 并将其绑定到FormView,DetailsView或ListView? How do you allow automatic updates, and filter the view to always be the user's own record? 您如何允许自动更新,以及如何将视图筛选为始终是用户自己的记录?

It seems like a lot of the data controls are geared towards dealing with multiple records. 似乎许多数据控件都旨在处理多个记录。 Or am I just missing something? 还是我只是想念一些东西?

ASP.NET MVC has scaffolding options that helps you build these sorts of views. ASP.NET MVC具有脚手架选项,可帮助您构建此类视图。 I prefer mvc these days as the designer generates most of what you need when you create views. 这些天,我更喜欢使用mvc,因为设计人员会在创建视图时生成所需的大部分内容。 There is also a way to modify the templates since they are are T4 templates. 由于它们是T4模板,因此还有一种修改模板的方法。

There is also Dynamic Data which can generate html dynamically from EF models. 还有动态数据 ,可以从EF模型动态生成html。 I played around with this a bit and was extremely impressed with how much you get right out of the box. 我对此进行了一些尝试,对您开箱即用的结果印象深刻。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM