寻找合适的DataBound控件来实现问题页面
我期待找到合适的 asp.net DataBound 控件 (C#) 在我的应用程序中实现。
我想创建一个考试页面,其中每页显示 10 个问题,每个问题都有一个 Label 控件和一个单选按钮控件来显示选项,要绑定到 DataBound 控件的数据可能有多行,其中每行代表每个问题。
我发现 DetailView 控件非常适合我的要求,但我无法设置页面大小。
请帮忙提供一些建议和意见,先谢谢您了。
I looking forward to find a suitable asp.net DataBound control (C#) to implement in my application.
I wanted to create a exam page where each page show 10 questions, each question got a Label control and a radiobutton control to display the choices, the data to be bind into the DataBound control might be having multiple rows where each rows represent each question.
I found that DetailView control was quite suit with my requirement but I not able to set the page size.
Please help to give some suggestion and advises, thank you in advanced.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我建议您使用 Repeater 控件,因为您可以非常轻松地自定义它的设计以满足您的需求。
这里有两个关于如何使用它的教程:
http://www.w3schools.com/aspnet/aspnet_repeater .asp
http://www.learn-asp.net/asptutorials/Repeater.aspx
更新:
Repeater 不包含分页,因此您必须添加它:
http://blog.divergencehosting.com/2009/03/25/adding-paging-repeater/
其他选项是仅使用包含分页的 GridView。
I would recommend to you to use the Repeater control since you can customize it's design very easily to suit your needs.
Here are two tutorials on how to use it:
http://www.w3schools.com/aspnet/aspnet_repeater.asp
http://www.learn-asp.net/asptutorials/Repeater.aspx
Update:
Repeater doesn't have pagination included so you would have to add it:
http://blog.divergencehosting.com/2009/03/25/adding-paging-repeater/
Other option would be to just use a GridView which has pagination included.
我会使用 DataList 或 ListView,因为它允许您为每个项目输入一个模板。我选择这些而不是中继器的原因是因为您可以使用数据密钥,这可能会派上用场。
以下是如何实施问题列表的简单示例:
I would use a DataList or a ListView, because it will allow you to enter a template for each item. The reason I would choose these over a repeater is because you can use data keys, which will probably come in handy.
Here's a simple example of how you could implement a list of questions: