R – Getting List Item URL in Sharepoint 2007

sharepointsharepoint-2007urlweb-parts

I'm creating a webpart that aggregates a load of content from different lists throughout our site collection what I can't workout is how to get the exact link to each item. All I seem to get back is {site}/{listtitle}/1.000 how do I get this "1.000" to say "pagename.aspx?id=1", is this something I have to work out myself or is there a function to do this?

Best Answer

How I do it:

string itemUrl = List.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl + "?id=" + item.ID;