gjshah7254
5/9/2014 - 4:55 AM

Change Page title or meta information

Change Page title or meta information

<script runat="server"> 
        private string Title { get; set;}
        private string Description { get; set;}
        private string Keywords { get; set;}
        protected override void OnDataBinding(EventArgs e)
        {
            base.OnDataBinding(e);
            // Get values from custom table
            Title = DataBinder.Eval(this.DataItem, "seo_title").ToString();
            Description = DataBinder.Eval(this.DataItem, "seo_desc").ToString();
            Keywords = DataBinder.Eval(this.DataItem, "seo_keywords").ToString();
            // Set values in meta tags
            CMSContext.CurrentTitle = Title;
            CMSContext.CurrentDescription = Description;
            CMSContext.CurrentKeyWords = Keywords;
        }
    </script>