button in Repeater item
-
When i work width tab ajax control, and in one tab, I have a Repeater:
and in
protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e)
method, i add a button and it's event:Button btn = new Button(); btn.Text = "Update"; btn.Click += new EventHandler(btn_Click); ((Repeater)source).Items[0].Controls.Add(btn); void btn_Click(object sender, EventArgs e) { Response.Redirect("http://google.com"); }
but when click on update button, event do not raise(btn do not drive click event). please help me ! Sorry for my english. :) -
When i work width tab ajax control, and in one tab, I have a Repeater:
and in
protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e)
method, i add a button and it's event:Button btn = new Button(); btn.Text = "Update"; btn.Click += new EventHandler(btn_Click); ((Repeater)source).Items[0].Controls.Add(btn); void btn_Click(object sender, EventArgs e) { Response.Redirect("http://google.com"); }
but when click on update button, event do not raise(btn do not drive click event). please help me ! Sorry for my english. :) -
It seems that you do not give your button object an ID, so it cannot decide which button to use. Maybe try that and see if the result is better? Good luck.
"My personality is not represented by my hometown."
-
It seems that you do not give your button object an ID, so it cannot decide which button to use. Maybe try that and see if the result is better? Good luck.
"My personality is not represented by my hometown."
-
Does your code work when you place the repeater outside of the AJAX control?
"My personality is not represented by my hometown."
-
Does your code work when you place the repeater outside of the AJAX control?
"My personality is not represented by my hometown."
-
When i work width tab ajax control, and in one tab, I have a Repeater:
and in
protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e)
method, i add a button and it's event:Button btn = new Button(); btn.Text = "Update"; btn.Click += new EventHandler(btn_Click); ((Repeater)source).Items[0].Controls.Add(btn); void btn_Click(object sender, EventArgs e) { Response.Redirect("http://google.com"); }
but when click on update button, event do not raise(btn do not drive click event). please help me ! Sorry for my english. :) -
Please run your page in debug mode, and set a breakpoint at the rp1_ItemCommand method. Then you can see what is causing this problem.
"My personality is not represented by my hometown."
-
When i work width tab ajax control, and in one tab, I have a Repeater:
and in
protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e)
method, i add a button and it's event:Button btn = new Button(); btn.Text = "Update"; btn.Click += new EventHandler(btn_Click); ((Repeater)source).Items[0].Controls.Add(btn); void btn_Click(object sender, EventArgs e) { Response.Redirect("http://google.com"); }
but when click on update button, event do not raise(btn do not drive click event). please help me ! Sorry for my english. :)Please read some documentation on ASP.Net first; Really try to take your time. Learning to program requires a lot patience and time. Then if you have questions, try to not post a question in 15 seconds, but really think how others will read it. So, give an explanation that is logical and describes the problem. Once I have more details on your issue I will be glad to help. Good luck!
"My personality is not represented by my hometown."
-
Please read some documentation on ASP.Net first; Really try to take your time. Learning to program requires a lot patience and time. Then if you have questions, try to not post a question in 15 seconds, but really think how others will read it. So, give an explanation that is logical and describes the problem. Once I have more details on your issue I will be glad to help. Good luck!
"My personality is not represented by my hometown."
-
When i work width tab ajax control, and in one tab, I have a Repeater:
and in
protected void rp1_ItemCommand(object source, RepeaterCommandEventArgs e)
method, i add a button and it's event:Button btn = new Button(); btn.Text = "Update"; btn.Click += new EventHandler(btn_Click); ((Repeater)source).Items[0].Controls.Add(btn); void btn_Click(object sender, EventArgs e) { Response.Redirect("http://google.com"); }
but when click on update button, event do not raise(btn do not drive click event). please help me ! Sorry for my english. :)