• 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.
Tom Knowlton
Tom Knowlton
  • 2
1 Solution
or this slight variation...but should also work with master pages...
Tom KnowltonWeb developerAuthor Commented:
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