How to programmatically add meta tag

Posted on 2006-04-20
Last Modified: 2012-06-21

I want to programmatically add “<meta http-equiv="Refresh" content="30"/>” to a single page that I am writing.  It is using 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.
Question by:knowlton
    LVL 37

    Expert Comment

    LVL 37

    Accepted Solution

    or this slight variation...but should also work with master pages...
    LVL 5

    Author Comment


    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now