0
我试图创建一个可视的Web部件来显示最新的5个公告列表项。Custom Share AnnouncementListItem Sharepoint 2010中的可视Web部件
我需要的公告列表项标题显示为链接和任何附件(仅图片)来显示正上方。我计划每隔15-20分钟刷新一次网络部分,以便能够显示最新消息。
我不知道如何以及什么最好的asp控件和页面设计将显示这些项目。
这里是CAML查询与我的代码的其余部分:
using (SPSite oSPsite = new SPSite("http://mySharePointWebApp:Port#/"))
{
using (SPWeb oSPWeb = oSPsite.OpenWeb())
{
oSPWeb.AllowUnsafeUpdates = true;
// Fetch the List
SPList list = oSPWeb.Lists["Announcements"];
SPQuery spQuery = new SPQuery();
//spQuery.Query = "<Where> <Eq> <FieldRef Name='Title' /> <Value Type='Text'></Value> </Eq> </Where>";
spQuery.Query = "";
spQuery.RowLimit = 5;
// Show item in text box
SPListItemCollection oListCollection = list.GetItems(spQuery);
foreach (ListItem oListItem in oListCollection)
{
// **What should I go with here?**
}
}
}
嗨肯感谢您的意见。我真的是新的编程,但想知道你是否可以扩大一点,我将如何实际绑定LINQ或CAML查询到列表框控件。 – user1266515 2012-03-16 13:02:37