Is it possible edit data in a repeater control

Skill/Topic: Advanced
A) No
B) Yes

Showing Answers 1 - 5 of 5 Answers

sinhapiyush

  • Feb 19th, 2006
 

yes its possible to edit data in repeater control. It can be done by placing a Placeholder control and dynamically generate textbox.

  Was this answer useful?  Yes

deep kumar sinha

  • Apr 4th, 2006
 

any body know that how can edit the data in a repeater control plz send me a code plzzzzzzzzzzzzz it`s very urgent

  Was this answer useful?  Yes

Saud

  • Jun 22nd, 2006
 

You add a lable and a TextBox, a linkbutton (or a button) in the ItemTemplte of a repeater, ..... ASPX ......





<%#DataBinder.Eval(Container.DataItem,"au_name")%>


Update


---codebehind---
private void Repeatert1_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e){ string newname="";
//search for all the controls to get their values Label l = new Label(); l=(Label)e.Item.FindControl("lblname"); LinkButton lb = new LinkButton(); lb=(LinkButton)e.Item.FindControl("lnkupdate"); TextBox t = new TextBox(); t=(TextBox)e.Item.FindControl("txtname"); Button b = new Button(); b=(Button)e.Item.FindControl("btnsave");
//check for the commandname of each button if(e.CommandName=="update") { l.Visible=false; lb.Visible=false; t.Visible=true; b.Visible=true; }
if(e.CommandName=="save") { newname = t.Text; l.Visible=true; lb.Visible=true; t.Visible=false; b.Visible=false;
//Im doing a Response.Write You can write code to update a DB. Response.Write(newname); }}..
Hope this helps

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions