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();
}
}
}
}
}
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