ASP.Net中父/子UI设计的最佳实践?

时间:2022-02-16 20:07:19

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.

来自桌面客户端背景,没有真正的数据驱动的网页设计经验,我正在研究ASP.NET UI设计,以确定父/子数据的最佳UI模式。

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.

在学习新的UI平台时,我总是倾向于尝试父/子演示,所以这就是我从这里开始的地方。我想我应该使用ASP.NET 2.0,我正在研究构建UI表单的各种方法,其中包含父记录的主列表,然后在单击父项时在页面的第二个网格中显示相关的子记录。最终,即使是儿童记录也是其他孩子的父母,所以我也需要处理。

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

想一想:在选定的开放订单中为所选客户/订单项打开订单/未结订单的客户...就像这个我在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?

我见过的一些技术只是为父母创建了一个简单的旧的shcool href链接表,有一些方法调用基于所选父项查询子项,而我见过的一些技术使用ASP.NET 2.0数据控制所有这一切。 ASP.NET 2.0数据控件是否作弊?真正的开发人员是否使用这些开箱即用的控件,或者他们输出自己的HTML以便他们可以拥有更多控制权?

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.

而且,看起来ASP.NET MVC现在风靡一时,所以我应该考虑一下。当我看一些关于它的介绍时,似乎需要退一步,因为看起来你必须手动创建大量的HTML来呈现列表和数据网格,而不是能够使用ASP.NET 2.0控件。

I'm kinda lost as to where to spend my energy.

我有点迷失在哪里消耗能量。

2 个解决方案

#1


1  

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.

我不会评论你所要求的父/子部分,而是评论你最后询问的WebForms vs ASP.NET MVC。

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.

我发现使用WebForms进行开发非常烦人。每当我想要从“规范”中做一些事情时,我就不得不与框架作斗争,让它以我想要的方式工作。

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.

ASP.NET MVC极大地减轻了这些负担。然而,它是以牺牲你可以开箱即用的各种酷组件为代价的。所以,是的,有更多的手工编码HTML,但最终这将使你的网页开发更加愉快。

#2


1  

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.

在我提出问题6个月之后回到这个问题,现在我已经获得了ASP.Net webforms的一些经验,我将回答我自己的问题。使用像ListView和GridView这样的实际Asp.net控件实际上并不是那么难,我可以看到在表单上使用它们确实是一种常见的做法,而不是觉得你是作弊。当然MVC强迫你降低html编码水平,但在WebForms应用程序上使用Asp.Net控件很好,实际上并不像我担心的那样难。

#1


1  

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.

我不会评论你所要求的父/子部分,而是评论你最后询问的WebForms vs ASP.NET MVC。

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.

我发现使用WebForms进行开发非常烦人。每当我想要从“规范”中做一些事情时,我就不得不与框架作斗争,让它以我想要的方式工作。

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.

ASP.NET MVC极大地减轻了这些负担。然而,它是以牺牲你可以开箱即用的各种酷组件为代价的。所以,是的,有更多的手工编码HTML,但最终这将使你的网页开发更加愉快。

#2


1  

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.

在我提出问题6个月之后回到这个问题,现在我已经获得了ASP.Net webforms的一些经验,我将回答我自己的问题。使用像ListView和GridView这样的实际Asp.net控件实际上并不是那么难,我可以看到在表单上使用它们确实是一种常见的做法,而不是觉得你是作弊。当然MVC强迫你降低html编码水平,但在WebForms应用程序上使用Asp.Net控件很好,实际上并不像我担心的那样难。