Wrox Programmer Forums
|
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2005, 07:11 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.


El Hombre que tiene Amigos ha de mostrarse Amigo
__________________
El Hombre que tiene Amigos ha de mostrarse Amigo
 
Old January 13th, 2005, 09:02 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Are you asking how to delete a row or change (UPDATE) data in a table?

 
Old January 13th, 2005, 12:43 PM
Authorized User
 
Join Date: Dec 2004
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I mean how to delete rows from a button in form.
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.


El Hombre que tiene Amigos ha de mostrarse Amigo





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
php/mysql delete button and delete query dungey PHP Databases 17 April 11th, 2009 12:24 PM
Datalist inside datalist amit.jagtap ASP.NET 2.0 Professional 1 September 4th, 2007 05:03 AM
How to delete an item of a xml file from datalist? MTLedari ASP.NET 2.0 Professional 0 April 23rd, 2007 03:27 PM
Datalist checkbox delete bayter ASP.NET 1.0 and 1.1 Basics 0 March 18th, 2005 12:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.