Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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