Duarte Nobrega
 

SPListItem.URL returns invalid URL?

12

Feb

SPListItem.Url returns an invalid URL?

something like: http://mossdev/Lists/ThisList/155_.000 ?

The way to is instead of using the following code:

   listItem.Url

Here goes two suggestions

1.   listItem.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + "?ID=" + listItem.ID

If this returns something like: http://mossdev/Pages/Lists/ThisList/DispForm.aspx?ID=155

This means you are using a relative URL. Build an absolute:

 

2.   listItem.Web.Url + "/" + listItem.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url + "?ID=" + listItem.ID

Duarte Nobrega schreef

Comments (0)

Duarte Nobrega

Zoeken

Categorie

Archief


Sign In