ASP.Net Div Hide from C#.net
private void loadInvestmentByProductAndGroup(int ProductId, int InvestmentGroupID) { ContentPlaceHolder mpContentPlaceHolder; System.Web.UI.HtmlControls.HtmlGenericControl currdiv1, currdiv2; mpContentPlaceHolder = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1"); if (mpContentPlaceHolder != null) { currdiv1 = (System.Web.UI.HtmlControls.HtmlGenericControl)mpContentPlaceHolder.FindControl("DivInvestmentGroup"); currdiv2 = (System.Web.UI.HtmlControls.HtmlGenericControl)mpContentPlaceHolder.FindControl("InvestmentDetail"); if (currdiv1 != null) { this.LoadInvestmentListByProductAndGroup(ProductId, InvestmentGroupID); //currdiv1.Visible = false; //currdiv2.Visible = true; } }