• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 824
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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