How to get the DisplayForm of an SPListItem

this is a code snippet that get the display form of an SPListItem

using (SPSite site = new SPSite("http://yoursite"))
{
    using (SPWeb web = site.OpenWeb())
    {
        SPList list = web.Lists[0];
        SPListItem item = list.Items[0];
        string diplayForm= String.Concat(item.Web.Url, "/",                   item.ParentList.Forms[PAGETYPE.PAGE_DISPLAYFORM].Url, "?id=", item.ID.ToString());
    }
}

great thx to http://www.peppedotnet.it

Enregistrer un commentaire