我来自桌面客户端背景,没有真正的数据驱动的 Web 设计经验,我正在研究 ASP.NET UI 设计,以确定父/子数据的最佳 UI 模式。
在学习新的 UI 平台时,我总是倾向于尝试父/子演示,所以这就是我的起点。 我认为我应该使用 ASP.NET 2.0,因此正在研究构建包含父记录主列表的 UI 表单的各种方法,然后在单击父记录时在页面上的第二个网格中显示相关的子记录。 最终,即使是子记录也是其他孩子的父记录,所以我也需要处理这个问题。
想一想:具有未结订单的客户/选定客户的未结订单/选定未结订单的行项目...就像我在 WPF 中构建相同内容的屏幕: http://www.twitpic.com/26w26
我见过的一些技术只是为父母创建一个简单的旧式 href 链接表,并调用一些方法根据选定的父级查询子级,而我见过的一些技术使用 ASP.NET 2.0 数据控件来解决所有这些问题。 ASP.NET 2.0 数据控件是否作弊? 真正的开发人员是否使用这些开箱即用的控件,或者他们是否输出自己的 HTML 以便拥有更多控制权?
另外,ASP.NET MVC 现在似乎很流行,所以我认为我应该考虑这一点。 当我查看一些关于它的介绍时,似乎倒退了一步,因为看起来您必须手动创建大量 HTML 来呈现列表和数据网格,而不是能够使用 ASP.NET 2.0 控件。
我有点迷失了,不知道该把精力花在哪里。
Coming from a desktop client background, with no real data-driven web design experience, I am studying ASP.NET UI design to determine the best UI pattern for Parent/Children data.
I always tend to experiment with Parent/Child presentation when learning a new UI platform, so that is where I have started here. Thinking I should use ASP.NET 2.0, I am studying the various ways of architecting a UI form which contains a master list of Parent records, and then showing the related children records in a second grid on the page when you click on a parent. Eventually, even the child records are parents to other children, so I'll need to deal with that also.
Think: Customers with Open Orders / Open Orders for Selected Customer / Line Items on Selected Open Order... like this screen where I built the same thing in WPF: http://www.twitpic.com/26w26
Some of techniques I've seen simply creates a plain old-shcool table of href links for the parents, with some method call to query the children based on the selected parent, while some techniques I've seen use the ASP.NET 2.0 data controls to work all this out. Are the ASP.NET 2.0 data controls cheating? Do real developers use these out-of-the box controls, or do they output their own HTML so they can have more control?
Also, it seems like ASP.NET MVC is all the rage right now, so I though I should consider that. When I looked at a few intro's about it, it seems to take a step back in time as it looks like you have to manually create much the HTML to present lists and datagrids, rather than being able to use the ASP.NET 2.0 controls.
I'm kinda lost as to where to spend my energy.
发布评论
评论(2)
我不会评论您所询问的父/子部分,而是评论您最后询问的 WebForms 与 ASP.NET MVC。
我发现使用 WebForms 进行开发非常很烦人。 每当我想做一些不符合“规范”的事情时,我都必须与框架进行斗争,以使其按照我想要的方式工作。
ASP.NET MVC 极大地减轻了您的这些负担。 然而,这样做的代价是无法拥有各种可以开箱即用的很酷的组件。 所以,是的,需要更多的 HTML 手动编码,但最终这将使您的页面开发变得更加愉快。
I won't comment on the Parent/Child portion of what you're asking, but rather on the WebForms vs ASP.NET MVC you asked about at the end.
I found developing using WebForms highly annoying. Every time I wanted to do something out of the "norm" I had to fight with the framework to get it to work the way I wanted.
ASP.NET MVC relieves you of these burdens greatly. However, it does so at the expense of having all kinds of cool components you can use out of the box. So yes, there is more hand-coding of the HTML, but ultimately that's what's going to make developing your pages a lot more pleasant.
在我提出这个问题 6 个月后回到这个问题,现在我已经获得了一些 ASP.Net Webforms 的经验,我将回答我自己的问题。 使用实际的 Asp.net 控件(如 ListView 和 GridView)并不是那么困难,而且我可以看到,在表单上使用它们确实是一种常见的做法,并且不会让人感觉自己在作弊。 当然,MVC 会迫使您进行较低级别的 html 编码,但在 WebForms 应用程序上使用 Asp.Net 控件很好,而且实际上并不像我担心的那么难。
Coming back to this question 6 months after I asked it, now that I've gained some experience with ASP.Net webforms, I'm going to answer my own question. Using the actual Asp.net controls like ListView and GridView is not really all that hard, and I can see that it is indeed a common practice to use them on forms and not feel like you a cheating. Sure MVC forces you to lower level html coding, but using Asp.Net controls on WebForms app is fine and actually not nearly as hard as I was affraid it would be.