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
Explain diff. Betn dataset and recordset?
Explain culture and uiculture values.
Define globalization and localization.
Explain the difference between Repeater and Data list control in ASP.NET?
What is advantage of code behind coding in ASP.NET?
Why will you usually create an aspnet user account in the database for an asp.net web application?
What’s the catch?
Which namespace is used by ado.net?
How is mvc different from asp.net? : Asp.Net MVC
Explain Optimization technique description?
What is the basic purpose of the required field validator? How can you use a required field validator to check that the user changes the initial value of a text box? a listbox?
What is server transfer?
What are session cookies?
How to comment out asp.net tags?
Explain what is postback in asp. Net?