Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Updating xsl link

$
0
0

Hello all,

I am trying to update xsl link programatically as shown below

using (SPSite site = new SPSite(SPContext.Current.Web.Url.ToString()))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPList list = web.Lists["My Custom List"];
                    SPView lstview = list.Views["My Custom View"];
                    XsltListViewWebPart XsltListViewWebPart1 = new XsltListViewWebPart();
                    XsltListViewWebPart1.WebId = list.ParentWeb.ID;
                    XsltListViewWebPart1.ListName = list.ID.ToString("B").ToUpper();
                    XsltListViewWebPart1.ListId = list.ID;
                    XsltListViewWebPart1.ViewGuid = lstview.ID.ToString("B").ToUpper();
                    XsltListViewWebPart1.XslLink = "http://mysite.com/mydocuments/myxslfiles/customfile.xslt";
                    XsltListViewWebPart1.CacheXslStorage = true;
                    XsltListViewWebPart1.CacheXslTimeOut = 84600;
                    lstview.Update();
                }
            }
Can I repeat the same using client object model?


Like Cricket


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>