Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 12th, 2005, 5:05 PM   #1
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
Talking How to delete labels into a datalist?

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>
see07 is offline   Reply With Quote
Old Jan 13th, 2005, 10:40 AM   #2
see07
Programmer
 
Join Date: Oct 2004
Posts: 37
Rep Power: 0 see07 is on a distinguished road
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>
see07 is offline   Reply With Quote
Old Jan 13th, 2005, 11:37 AM   #3
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
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!
Pizentios is offline   Reply With Quote
Old Jan 13th, 2005, 1:11 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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)
with another loop (using j, of course).
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:13 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC