![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2004
Posts: 37
Rep Power: 0
![]() |
Hello:
I’ve a several labels containing data from a table into a datalist. Now I desire through a button in form, delete data contained in labels into datalist. Does somebody know how to achieve it (obviously in C# or maybe using javascript). Thanks you in advance. A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span> |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Oct 2004
Posts: 37
Rep Power: 0
![]() |
At last I found the way to achieve it in C#, I show you code:
private void Button1_Click(object sender, System.EventArgs e) { for (int i = 0;i <= DataList1.Items.Count -1; i++) { ((Label)DataList1.Items[i].FindControl("Label1")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label2")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label3")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label4")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label5")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label6")).Text = ""; ((Label)DataList1.Items[i].FindControl("Label7")).Text = ""; } } But I’d like to know how achieve same thing using javascript. I’ll thank you your help. A.L.
__________________
<span style='color:red'>El Hombre que tiene Amigos, debe mostrarse Amigo...</span> |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() |
Glad to hear that you've got it working.
__________________
Profanity is the one language that all programmers understand. Check out my Blog <---updated Nov 30 2007! |
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
What's the string concatenation operator in C#? And how do you convert numbers to strings? I ask this because that could be made a lot simpler if you used the equivalent of:
"Label" + itoa(j) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|