How to get the item link in the moss list

Source: Internet
Author: User

The URL attribute of splistitem does not return an absolute path. The format is shown below:
Http: // Cary/lists/discussion/itemtitle
This form cannot be opened as a link. In many cases, when we get this item, we also need to get the URL of this item, for example, when you filter the specified data in the column table and send an email to relevant personnel, you need a link to this item in the email content.

A pagetype enumeration is provided in Moss, as shown in the following table:

Name Description
Page_defaultview Default view. value = 0.
Page_dialogview File Dialog Box view. value = 2.
Page_displayform Display form for list items. value = 4.
Page_displayformdialog Display form for a file dialog box. value = 5.
Page_editform Edit form for list items. value = 6.
Page_editformdialog Edit form for a file dialog box. value = 7.
Page_invalid Not used. value =-1.
Page_maxitems Not used. value = 11.
Page_newform New Form for list items. value = 8.
Page_newformdialog New form for a file dialog box. value = 9.
Page_normalview Normal view. value = 1.
Page_solutionform Solution form. value = 10.
Page_view View, including both default view and normal view. value = 3.

We can use the followingCodeTo get the link of the item:
Splist list = site. Lists. getlist ("/lists/discussion ");
Splistitem item = List. items [ID];
String strurl = List. Forms [pagetype. page_displayform]. url + "? Id = "+ item. ID

You can obtain the following link:
Http: // Cary/lists/discussion/dispform. aspx? Id = 680
This can be opened as a link.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.