Getting CSS stylesheet data

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can get a CSS stylesheet as a CssStylesheetInfo object:




using CMS.SiteProvider;




        // Get stylesheet object by ID

      CssStylesheetInfo csi = CssStylesheetInfoProvider.GetCssStylesheetInfo(1);


      // Get stylesheet object by stylesheet name

      CssStylesheetInfo csi2 = CssStylesheetInfoProvider.GetCssStylesheetInfo("CorporateSite");


The following sample code shows how you can get a DataSet containing CSS stylesheets:




using System.Data;

using CMS.SiteProvider;

using CMS.CMSHelper;




        string siteName = CMSContext.CurrentSiteName;

      string where = "";

      string orderBy = "";

      string columns = "";

      int topN = 10 ;


      // Get dataset of stylesheets according to the given parameters

      DataSet ds2 = CssStylesheetInfoProvider.GetCssStylesheets(siteName);


      DataSet ds3 = CssStylesheetInfoProvider.GetCssStylesheets(where, orderBy);


      DataSet ds4 = CssStylesheetInfoProvider.GetCssStylesheets(where, orderBy, topN);


      DataSet ds5 = CssStylesheetInfoProvider.GetCssStylesheets(where, orderBy, topN, columns);


      // Get dataset of all stylesheet objects

      DataSet ds = CssStylesheetInfoProvider.GetAllCssStylesheets();


Page url: