• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 803
  • Last Modified:

How to programmatically add meta tag


I want to programmatically add “<meta http-equiv="Refresh" content="30"/>” to a single page that I am writing.  It is using ASP.net 2.0 in c#

I have a masterPage.  I am able to change the title of the page but whenever I add the above it breaks my styles and everything is the default html look.  The code that I am trying is below

 

protected void Page_Load(object sender, EventArgs e)

    {

Master.Page.Title = title;

Master.MasterPageLabel.Text = "<h1>"+title+"</h1>";

Master.Page.Header.InnerHtml = "<meta http-equiv=\"Refresh\" content=\"30\"/>"

}

 

Title is declared earlier on the page.
0
Tom Knowlton
Asked:
Tom Knowlton
  • 2
1 Solution
 
samtran0331Commented:
0
 
samtran0331Commented:
or this slight variation...but should also work with master pages...
http://www.c-sharpcorner.com/UploadFile/Ashish1/metatags04052006015900AM/metatags.aspx
0
 
Tom KnowltonWeb developerAuthor Commented:
Thanks!
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now