Monday, 18 June 2012

ASCX.CS (ascx.cs)

STEP 1: Create a VisualWebPart like RecentlyViewedPages

STEP 2: Write a coding in RecentlyViewedPagesUserControl.ascx.cs 


STEP 3:


using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using System.Data;
using VCSB.INTRANET.BLL;

namespace VCSB01.INTRANET.RecentlyViewedPages
{
    public partial class RecentlyViewedPagesUserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DataTable dtRecent=SiteHelper.GetRecentlyViewedPages();
                if (dtRecent != null && dtRecent.Rows.Count != 0)
                {
                    grdRecentPages.DataSource = dtRecent;
                    grdRecentPages.DataBind();
                }           
            }

        }
    }
}

No comments:

Post a Comment

SharePoint online - Get List-item attachments and Display to div

Step 1 : Create a List ex: TestList and attach few images Step 2 : Copy and Pastet the below coding in App.js var  Items =  null ; ...