i have given task that i have to create three tabs ,morning & day & evening inside morning tab i have to display button from 10:00 am to 12 :pm similarly for day and evening i have to make three tabs on page load with click of there button .i have done but getting error like all button disappear on click of any button.. please answer me how to do it and also how to select/deselect clicked button with color .
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack)
{
// Response.Write(((Button)pnlButtons.FindControl("10-0")).);
}
}
protected void Tab3_Click(object sender, EventArgs e)
{
List<Button> buttons = new List<Button>();
for (int i = 4; i < 6; i++)
{
for (int j = 0; j < 60; j += 15)
{
Button btn = new Button();
btn.Text = i + "-" + j;
btn.ID = i + "-" + j;
//btn.Click += new System.EventHandler(btntime_Click);
btn.Click += btn_Click;
pnlButtons.Controls.Add(btn);
Label1.Text = "your sheduled time between 4 PM to 6 PM";
}
}
at aspx page
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…