Retrieve the name of a document which saved in a SharePoint library using Client Object Model

StackOverflow https://stackoverflow.com/questions/17541014

سؤال

        foreach (SPListItem item in listitems)

        {
            AttachmentControlTemplate atch_templt = new AttachmentControlTemplate(countr);
            atch_templt.lnk_btn.Text = item.File.Name;
            atch_templt.lnk_btn.OnClientClick = "window.open('" + site_url + "/" + item.File.Url + "')";

        }      

Above sever side code shows the way of retrieving the name of a document which saved in a SharePoint document library by using "item.File.Name",i have done this completely, but how do i do same thing by using Client Object Model. What should i use instead of "item.File.Name".

Would anyone help me to sort this out ??

Any help is greatly appreciated.

هل كانت مفيدة؟

المحلول

finally i have found the way to get the Url of a saved document. i am sharing it with others. i have retrieved the file name and concatenated with the Url of the document library.

var fileUrl = "Document library Url" + "File Name";

By using above fileUrl, the document can be opened.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top