Abhimanyu Singh

Abhimanyu Singh

  • NA
  • 116
  • 49k

How to send a google analytics code in master page by dynam

Oct 31 2013 2:23 AM
Hello all here,

Please help me in...

How to send a google analytics code (Java script code) in master page by dynamic way..

As i created one dynamic page in my admin panel..where i fetched this google analytics code (Java script code) form Data Base on dropdownlist1 selected index...mean that i filld this code manually in DB...now when we will select master page on dropdown it will display this code...in textbox..Now
I want when we will update this code on button click it should reflect on both (in DB and also in header of master page)...its taking update in Db..but not in master page my code is mentioned below....

.CS code : 

 private void SeoAnalytics()
        {
            DataTable dtSeoAna = new DataTable();
            try
            {
                Uri uri = new Uri(Request.Url.AbsoluteUri);
                string filename = Path.GetFileName(uri.LocalPath);

                clsSeoKeywords objAnalytics = new clsSeoKeywords();
                dtSeoAna = objAnalytics.SeoAnalyticsDisplay("display", filename.Trim());
                if (dtSeoAna != null && dtSeoAna.Rows.Count > 0)
                {

                   // Page.Title = dtSeoAna.Rows[0]["Analytics"].ToString().Trim();
                   Page.RegisterStartupScript("MyScript", dtSeoAna.Rows[0]["Analytics"].ToString().Trim());

                                  
                }

            }
            catch (Exception ex)
            {

            }
            finally
            {
                //dtMetaTag.Dispose();
            }
        }