I have 2 lists.

List1 (Customer) is populated with items.........

List2 (Orders) I am busy populating, in List2 I have a Hyperlink field (customer) which (should) link to List1

So when the user is browsing List2 (Orders) I want him/her to be able to click on the customer field link and get taken to the custom list item in List1 (Customer)

I'm using object model to populate List2, I'm trying this without luck:

// Items[0] = the SPListItem for my Customer List Item
SPListItem item = items[0];

item.Url.ToString(); // this returns - Lists/[MyOrderListName]/1735_.000

However setting the value of the order list item like this:

oListItem["PLANS"] = siteURL + customerLink + ", " + customerName;

Gives me: http://myServer.com/Lists/[MyOrderListName]/1735_.000]

This is not the correct url to the list item, so how can I format the link so it really points to the list item?

Thanks in advance

UPDATE: The short version

What is the URL for a list item in a list?

Because -

SPListItem item = items[0];

Does not produce a valid browsable link for the user.

1 Answer 1


How about: http://site/web/list/DispForm.aspx?ID=[your item's ID] ?

  • Looks good, let me try it :)
    – user879
    Dec 22, 2010 at 12:14
  • Works like a charm, and I spotted a dynamic way to get the display form URL (its relative) item.ParentList.DefaultDisplayFormUrl
    – user879
    Dec 22, 2010 at 12:18

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.