This post will be a smaller one, but maybe it helps you some day. In a customer project we had to send mails if an item has reached a defined status. In that mail the user should get an link to the item edit form, that he has not to search for the mentioned item. Therefore we provided a link to the item itself and its edit form. We used therefore this script:
[sourcecode language=”csharp”]
string.Format(“{0}/{1}?ID={2}”, item.Web.Url, item.ParentList.Forms[PAGETYPE.PAGE_EDITFORM].Url, item.ID);
PAGETYPE.PAGE_DISPLAYFORM
[/sourcecode]
It puts together 3 item properties:
item.Web.Url = http://yourserver/sites/yoursite
item.ParentList.Forms[PAGETYPE.PAGE_EDITFORM].Url = Lists/Editform.aspx
item.ID = the ID of the item
Therefore we put it into the string. That’s it. The same can be done with new form and display form – you just have to change the pagetype.
..:: I LIKE SHAREPOINT ::..
Leave a Reply