Tuesday, 14 February 2012

how to add multiple user control in asp.net

PressMe
protected void gv_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
ph.Controls.Add(LoadControl("WebUserControl.ascx"));
Session["i"] = Convert.ToInt32(Session["i"]) + 1;
}

protected void Page_Init(object sender, EventArgs e)
{
for (int i = 0; i < Convert.ToInt32(Session["i"]); i++)
{
ph.Controls.Add(LoadControl("WebUserControl.ascx"));
}
}

No comments:

Post a Comment