Link to home
Start Free TrialLog in
Avatar of tolppa
tolppa

asked on

SP2010: How to get url to Announcements list item?

Hello. I am creating a simple Visual WebPart that reads data from announcements list. I can read announcement list with:

SPSiteDataQuery dataQuery = new SPSiteDataQuery();
 dataQuery.Webs = "<Webs Scope=\"SiteCollection\">";
 dataQuery.Lists = "<Lists ServerTemplate=\"104\" />";

 dataQuery.ViewFields = string.Concat(
  "<FieldRef Name=\"Modified\"/>", "<FieldRef Name=\"Title\"/>", "<FieldRef Name=\"Body\"/>");
 dataQuery.Query = "<Where><IsNotNull><FieldRef Name=Title/>
</IsNotNull></Where>";


SPWeb w = site.OpenWeb();
//dtable = web.GetSiteData(dataQuery);
dtable = w.GetSiteData(dataQuery);

w.Dispose();

Open in new window


But ... How can I get an URL of actual announcement?
ASKER CERTIFIED SOLUTION
Avatar of tolppa
tolppa

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial