RSS

Tag Archives: Content PlaceHolders

Add Dynamic Controls to Content PlaceHolders in ASP.Net

            ContentPlaceHolder holder = Page.Master.FindControl("message") as ContentPlaceHolder;
            HtmlGenericControl alertControl = new HtmlGenericControl();
            alertControl.Attributes["class"] = "alert alert-success";
            alertControl.TagName = "div";
            holder.Controls.Add(alertControl);
            Label message = new Label();
            message.Text = "User deleted successfully.";
            alertControl.Controls.Add(message);
Advertisements
 
Leave a comment

Posted by on March 20, 2015 in ASP.Net

 

Tags: