Chinna Netha

Chinna Netha

  • NA
  • 282
  • 138.3k

Compilation Error:how to create method dynamically in asp.ne

May 31 2015 2:28 AM
WebApplication1.Current_Affairs._2015.vinod' does not contain
a definition for 'page' and no extension method 'page' accepting a
first argument of type 'WebApplication1.Current_Affairs._2015.vinod'
could be found (are you missing a using directive or an
assembly reference?)


Line 8: pagedesc.Name = "Description";
Line 9: pagedesc.Content = "sdfadsdf";
Line 10: this.page.Header.Controls.Add(pagedesc);--->>>>ERROR
Line 11: HtmlMeta pagekeywords = new HtmlMeta();
Line 12: pagekeywords.Name = "keywords";




my code is:
" protected void Page_Load(object sender, EventArgs e) {",
" HtmlMeta pagedesc = new HtmlMeta();",
" pagedesc.Name = \"Description\";",
" pagedesc.Content ="+TextBox2.Text+";",
" this.page.Header.Controls.Add(pagedesc);",
" HtmlMeta pagekeywords = new HtmlMeta();",
" pagekeywords.Name = \"keywords\";",
" pagekeywords.Content = "+TextBox3.Text+";",
" Header.Controls.Add(pagekeywords);",
" output.Text = \""+txtpagename0.Text.ToString()+"\";",
" }",

Answers (3)