Can you edit data in the Repeater control?
Answer Posted / sivaprasad
Yes We Can Edit Data In a RepeaterControl,it is based on our
designing
Example:Display Data What Ever YOU want in Labels and same
data in to Textboxes(visible = false) while page is loading
and when user clicks Edit Button put all labels to visible
false and and all text boxes to visible true,
foreach(control con in Repeater.Items)
{
foreach(Control ctl in con.Controls)
{
if(ctl is TextBox)
{
((Textbox)ctl).Visible = true;
}
if(ctl is Label)
{
((Label)ctl).visible = false;
}
}
}
After This Iterate Through All Items in Our Repeater Like
for(int i=0;i<Repeater.Items.Count;i++)
{
string txt =
((Textbox)Repeater.Items[i].FindControl("Textboxid")).Text;
}
Get The Edited Text Like This And Update into Database
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Is asp.net 64-bit enabled? How?
What is asp.net mvc5? : Asp.Net MVC
In Code-Behind class which kind of code (server or client) is found ?
What is a postback in asp net?
What are the events in a page life cycle?
What is the difference between trace and debug in asp.net?
How can you pass multiple complex types in Web API?
Hi All, Im an MCA holder with 3+ years of experience in asp.net. Now i want to move to some good government job. I have no idea about different categories of exams held & which one can be applicable for my education background. I have done B.A with MCA. Please help me out with your valuable suggestions. I would be very grateful. Thanks Anuj
What are strong names?
Can viewstate be accessed in another page?
Explain About duration in caching technique
Explain the difference between Web Garden and Web Farm?
Why do we use datasource in asp.net?
How do I use a proxy server when invoking a web service?
Differentiate between file-based dependency and key-based dependency.