Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Accessing Delete Command from a button in a Repeater Control

Reply
Thread Tools

Accessing Delete Command from a button in a Repeater Control

 
 
MU
Guest
Posts: n/a
 
      01-20-2009
Hello,

How would I access the Delete command from a button in a DataList that
is databound to a SQLDataSource and the whole thing is within a
Repeater control?

This is what I have right now:
Protected Sub lstItineraryDayItems_DeleteCommand(ByVal source As
Object, ByVal e As DataListCommandEventArgs)
Dim dList As DataList = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("lstItineraryDayItems")
Dim sqlItin As SqlDataSource = repeaterDays.Controls
(repeaterDays.Controls.Count - 1).FindControl("sqlItineraryDayItems")

Dim id As Integer = CInt(dList.DataKeys(e.Item.ItemIndex))
sqlItin.DeleteParameters("ItineraryDayItemsID").De faultValue =
id
sqlItin.Delete()
End Sub

But I'm not sure if that is correct and I'm not sure how I would call
if it is....

Any help would be great!

Thanks
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Datagrid Cancle/update button calles delete command? cjb@goldmancg.com ASP .Net Datagrid Control 1 08-24-2005 06:22 PM
Accessing data object on delete command. Cappy ASP .Net Datagrid Control 1 04-20-2005 06:17 PM
Repeater control with nested repeater chris.reed@digus.com ASP .Net 0 02-11-2005 05:10 PM
Add Confirm to Delete button in repeater Roger Twomey ASP .Net Datagrid Control 1 06-05-2004 12:28 AM
suppressing Submit command with a Delete button Elliot M. Rodriguez ASP .Net 4 12-17-2003 01:27 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57