使用 EF 和 ASP.NET 控件构建会员页面的最佳方法?
我正在尝试建立一个包含会员部分的网站,并且我正在努力寻找一种快速有效的方法来构建最终用户页面,这将提取用户的数据。
例如,用户的“我的帐户”页面。 他们只需要能够查看和编辑数据即可。 您会使用实体框架EntityDataSource 控件吗? 并将其绑定到 FormView、DetailsView 或 ListView? 如何允许自动更新,并过滤视图以始终是用户自己的记录?
看起来很多数据控件都是为了处理多个记录。 或者我只是错过了什么?
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? And bind it to a FormView, DetailsView, or 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ASP.NET MVC 具有脚手架选项,可帮助您构建此类视图。 现在我更喜欢 mvc,因为设计器会在您创建视图时生成您需要的大部分内容。 由于模板是 T4 模板,因此还有一种修改模板的方法。
还有动态数据,可以从 EF 模型动态生成 html。 我玩了一下这个,对开箱即用的效果印象深刻。
ASP.NET MVC has scaffolding options that helps you build these sorts of views. I prefer mvc these days as the designer generates most of what you need when you create views. There is also a way to modify the templates since they are are T4 templates.
There is also Dynamic Data which can generate html dynamically from EF models. I played around with this a bit and was extremely impressed with how much you get right out of the box.