Sharepoint 2013: Get url of discussions in Discussions List
-
09-12-2019 - |
Question
Im working on Sharepoint 2013 Community site, Im developing a custom webpart where I filter the discussions and displaying the title of the discussions as a Hyperlink. How can I find the url of the discussions to set it to hyperlinks that are displyed in the custom webpart
Solution
Hi I found out the answer for this question. All the urls of the discussions are stored in the discussions list but we can access only through the code we cannot display that column in any views. I'll share my code below
foreach (SPListItem post in oSpListItemClnPost)
{
String postUrl = post["URL Path"].ToString();
String url = oSpSite.Url;
url += "/SitePages/Topic.aspx?RootFolder=" + postUrl;
}
So string url will be the final url of the discussions in the discussions list.
Thank You
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange