动态添加UpdatePannel

aspx
     < form id = " form1 "  runat = " server " >
        
< asp:ScriptManager ID = " ScriptManager1 "  runat = " server " >
        
</ asp:ScriptManager >

    
</ form >

cs
     protected   void  Page_Load( object  sender, EventArgs e)
    {
        UpdatePanel up 
=   new  UpdatePanel();
        up.ID 
=   " UpdatePanel1 " ;
        
this .Form.Controls.Add(up);

        LiteralControl lc 
=   new  LiteralControl(DateTime.Now.ToString());
        up.ContentTemplateContainer.Controls.Add(lc);

        Button btn 
=   new  Button();
        btn.Text 
=   " Refresh " ;
        up.ContentTemplateContainer.Controls.Add(btn);
    }

你可能感兴趣的:(update)