我正在创建一个面向外部的 SharePoint 网站,其中包含许多自定义列表。 其中一些非常复杂。
我通常会像避免瘟疫一样避免使用 SharePoint Designer,而更喜欢坚持使用 Visual Studio。
要向用户显示列表项,我应该真正尝试并开始制作自定义 DispForm.aspx 还是最好创建我自己的自定义 asp.net 页面,将项目 id 传递到其中并使用后面的代码填充页面?
如果我选择第二个选项,是否有一种方法可以将列表项“绑定”到页面,以便我可以直接访问字段,或者我是否必须进行文字替换等?
谢谢
I am createing an external facing SharePoint site which contains a number of custom lists. Some of these are extremely complicated.
I generally avoid using the SharePoint Designer like the plague, preferring to stick to Visual Studio.
To display a list item to users should I really try and get my head around making a custom DispForm.aspx or would is it better to create my own custom asp.net page, pass the item id into it and populate the page using code behind?
If I go the second option is there a way to 'bind' the list item to the page so I can directly access the fields or would I have to do literal replacement etc?
Thanks
发布评论
评论(3)
最好的办法是在 SP Designer 中自定义表单并使用一项功能来部署修改后的列表页面。
您可以通过修改列表 schema.xml 并在底部指定自定义列表页面来完成此操作。
Best thing to do is, customize the form in SP Designer and use a feature to deploy the modified list pages.
You can do this by modifying the list schema.xml and specifiying your custom list pages at the bottom.
这取决于您想要在显示表单中进行哪种自定义。
您是否尝试以与两列列表不同的方式排列字段? (您需要创建自定义ListItemIterator&渲染模板)请参阅此了解更多信息。 拥有 ListIterator 后,您需要编写自定义列表模板,并且在 Schema.xml 末尾,您需要将模板设置为您的自定义模板。
<前><代码><表格>;
<表单类型=“DisplayForm”Url=“DispForm.aspx”模板=“CustomListForm”SetupPath=“pages\form.aspx”WebPartZoneID=“Main”/>/>
并回答第二个问题如何绑定。 您可以尝试 SPDataSource 和 此。这将允许您获取单个项目的详细信息。将模式指定为 ListItem
Its depends on what Kind of customization you wanted in the Display form.
Are you trying to get the Fields arranged in a different fashion unlike Two column listing? ( You need to create a Custom ListItemIterator & Rendering Template) Refer this for more information. Once you have the ListIterator then you need to write a custom List Template and in the end of Schema.xml you need to set the Template to your custom Template.
And to answer the second Question on how to bind. You can Try out SPDataSource and this.This will allow you get the details for the Single Item.Specify the mode to ListItem
我最终创建了一个完全独立的 ASP.Net 页面,该页面仅引用列表并根据需要使用查询参数等显示项目,
这效果很好
I ended up creating a completely seperate ASP.Net page that just referenced the List and displayed items as needed with query parameters etc
This worked well