Hi i have added one div in aspx page and i want to take the Id of that div in code behind file by using webcontro
Add runat="server" to the DIV then you can easily find it. using
this.Page.FindControl("Id of Div");
protected System.Web.UI.WebControls.div divId
I want to add in above way
System.Web.UI.HtmlControls.HtmlGenericControl div = new System.Web.UI.HtmlControls.HtmlGenericControl(); div.ID = "div1"; div.InnerHtml = "Hello"; this.Form.Controls.Add(div);
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.