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


Please Help Members By Posting Answers For Below Questions

What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

582


Define authentication and authorization.

615


Which adapter should you use, if you want to get the data from an access database?

535


What is a web based system?

458


What is difference between ispostback and autopostback in asp net?

514






When does a session actually start?

563


Define the term Web Garden?

548


Explain how to prepare culture-specific formatting in .net.

528


What is bson in web api?

585


In a Repeater control how one can provide an alternating color scheme ?

560


Explain the steps needed to be performed in order to create an animation in xaml?

550


If I am developing an application that must accomodate multiple security levels though secure login and my asp.net web application is spanned across three web-servers (using round-robin load balancing). What would be the best approach to maintain login-in state for the users?

637


How to send a DataReader as a parameter to a remote client ?

2713


What is an assembly? Explain its parts.

625


What is web router?

498