Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Ajax "Update Panel" control error

Ajax "Update Panel" control error

Scheduled Pinned Locked Moved Web Development
designhelpannouncementlearning
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kmb89
    wrote on last edited by
    #1

    I have a error in learning Ajax lessons. The error is "UpdatePanel does not contain a definition for ContentTemplateContainer". Following is my codes: public partial class UpdatePanel1 : System.Web.UI.Page { private Label label1; protected void Page_Load(object sender, EventArgs e) { UpdatePanel l_UpdatePanel = new UpdatePanel(); l_UpdatePanel.ID = "UpdatePanel1"; //Create the label label1 = new Label(); label1.ID = "Label1"; label1.Text = DateTime.Now.ToString(); //Create the button Button l_Button = new Button(); l_Button.ID = "Button1"; l_Button.Click += new EventHandler(l_Button_Click); //Create the literals LiteralControl l_LiteralControl = new LiteralControl(); //Embed the controls to the UpdatePanel l_UpdatePanel.ContentTemplateContainer.Controls.Add(label1); l_UpdatePanel.ContentTemplateContainer.Controls.Add(l_LiteralControl); l_UpdatePanel.ContentTemplateContainer.Controls.Add(l_Button); //Add the update panel to the form this.Controls.Add(l_UpdatePanel); } void l_Button_Click(object sender, EventArgs e) { this.label1.Text = DateTime.Now.ToString(); } }

    A 1 Reply Last reply
    0
    • K kmb89

      I have a error in learning Ajax lessons. The error is "UpdatePanel does not contain a definition for ContentTemplateContainer". Following is my codes: public partial class UpdatePanel1 : System.Web.UI.Page { private Label label1; protected void Page_Load(object sender, EventArgs e) { UpdatePanel l_UpdatePanel = new UpdatePanel(); l_UpdatePanel.ID = "UpdatePanel1"; //Create the label label1 = new Label(); label1.ID = "Label1"; label1.Text = DateTime.Now.ToString(); //Create the button Button l_Button = new Button(); l_Button.ID = "Button1"; l_Button.Click += new EventHandler(l_Button_Click); //Create the literals LiteralControl l_LiteralControl = new LiteralControl(); //Embed the controls to the UpdatePanel l_UpdatePanel.ContentTemplateContainer.Controls.Add(label1); l_UpdatePanel.ContentTemplateContainer.Controls.Add(l_LiteralControl); l_UpdatePanel.ContentTemplateContainer.Controls.Add(l_Button); //Add the update panel to the form this.Controls.Add(l_UpdatePanel); } void l_Button_Click(object sender, EventArgs e) { this.label1.Text = DateTime.Now.ToString(); } }

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      You need to check this before doing a single line of code : http://forums.asp.net/t/982600.aspx[^] You need to create CompiledTemplateBuilder to access ContentTemplateContainer. :)

      Abhishek Sur **Don't forget to click "Good Answer" if you like this Solution.


      My Latest Articles-->** Simplify Code Using NDepend
      Basics of Bing Search API using .NET
      Microsoft Bing MAP using Javascript

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups