使用 XmlDataSources 的主视图/详细信息视图
我有一个基本的测试 Web 表单,其中包含 DataList 和 DetailsView 以及每个组件的两个 XmlDataSource 组件。
DataList 与底层 XML 文档的绑定很容易设置,但我在连接 DetailsView 方面遇到了困难。 这个想法是,两个可绑定控件之间存在主/详细信息关系,因此我想我应该挂钩 DataList 上的 OnSelectedItemIndexChanged 来绑定 DetailsView 中当前选定的项目。 但是,当我使用 XmlDataSource 使其正常工作时,相关键是什么/如何设置 DataKeyField?
干杯,
--larsw
I have a basic test web form with a DataList and a DetailsView and two XmlDataSource components for each of them.
The binding of the DataList to the underlying XML document was easy to set up, but I'm struggling with getting the DetailsView hooked up. The idea is that there is a master/details relationship between the two bindable controls, so I guess I should hook onto the OnSelectedItemIndexChanged on the DataList to do the binding of the currently selected item in the DetailsView. But what is the correlating key / how do I set a DataKeyField when I use a XmlDataSource to get this to work?
cheers,
--larsw
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道 ,
但看看这些链接,希望有所帮助:
http://www.eggheadcafe.com/tutorials/aspnet/d89d1d96-03f1-4784-bbb2-a3db1af393f5/aspnet-datalist-and-data.aspx
http://safari.informit.com/9780735625273/index?indexview=D
http://my.safaribooksonline.com/0735621764/index?indexview=D
http://blogs.msdn.com/adrianvinca/archive/ 2006/02/15/532449.aspx
http://safari.informit.com/9780735625273/index?indexview=D
I'm not sure ,
But look at these links , hope to help :
http://www.eggheadcafe.com/tutorials/aspnet/d89d1d96-03f1-4784-bbb2-a3db1af393f5/aspnet-datalist-and-data.aspx
http://safari.informit.com/9780735625273/index?indexview=D
http://my.safaribooksonline.com/0735621764/index?indexview=D
http://blogs.msdn.com/adrianvinca/archive/2006/02/15/532449.aspx
http://safari.informit.com/9780735625273/index?indexview=D
哇! 我现在正在这样做,但是使用对象数据源:)
我正在遵循 Matt Berseth 的精彩教程,查看他的帖子。
几乎是一样的,唯一的区别就是你使用了其他的DataSource,其他的都是一样的!
Wow! I'm doing exactly that right now but using Object Data Source :)
I am following a great tutorial on that from Matt Berseth, check his post.
It will be almost the same, the only thing is that you use other DataSource, but the rest is the same!