title: Run-time Error for adding attribute in html meta tag
body: <p>Here is my code:</p>
  
  <pre><code> public partial class Image : System.Web.UI.Page {
       protected void Page_Load(object sender, EventArgs e)
       {
           HtmlMeta tag = new HtmlMeta();
           tag.Attributes.Add("property", "og:type");
           Header.Controls.Add(tag);
       }
  }
  </code></pre>
  
  <p>This is my error:</p>
  
  <blockquote>
    <p>Server Error in '/Kidzania' Application. Object reference not set to
    an instance of an object. Description: An unhandled exception occurred
    during the execution of the current web request. Please review the
    stack trace for more information about the error and where it
    originated in the code.</p>
    
    <p>Exception Details: System.NullReferenceException: Object reference not
    set to an instance of an object.</p>
    
    <p>Source Error:</p>
  </blockquote>
  
  <pre><code>Line 18:         HtmlMeta tag = new HtmlMeta(); 
  Line 19:         tag.Attributes.Add("property", "og:type"); 
  Line 20:         Header.Controls.Add(tag); 
  </code></pre>
  
  <blockquote>
    <p>Source File: d:\Kidzania\Image.aspx.cs    Line: 20</p>
    
    <p>Stack Trace:</p>
    
    <p>[NullReferenceException: Object reference not set to an instance of an
    object.]    Image.Page_Load(Object sender, EventArgs e) in
    d:\Kidzania\Image.aspx.cs:20<br>
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object
    o, Object t, EventArgs e) +14<br>
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,
    EventArgs e) +35    System.Web.UI.Control.OnLoad(EventArgs e) +99<br>
    System.Web.UI.Control.LoadRecursive() +50<br>
    System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    +627</p>
  </blockquote>
  
  <p>i am refer all <strong>stackoverflow</strong>  answer but not solve that problem please any help to assisted me please. thanks in advance for your answers</p>