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

1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.