Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

BUTTON WITHIN GRIDVIEW

ok so i have a button within gridveiw
 <asp:Button ID="Button1" OnClick="delete" runat="server" Text="Delete" />

Open in new window


when its clicked i want to run my class
deletepost(url)

Open in new window


how can i do this ??

     Dim delete As Button = CType(e.Row.FindControl("Button1"), Button)
            Dim url As String = e.Row.DataItem("ID").ToString

Open in new window

0
runnerjp2005
Asked:
runnerjp2005
  • 3
1 Solution
 
dj_alikCommented:
0
 
HainKurtSr. System AnalystCommented:
something like this on GridView_RowCommand(..) event:

Dim index As Integer = Convert.ToInt32(e.CommandArgument)
' Retrieve the row that contains the button clicked
' by the user from the Rows collection.
Dim row As GridViewRow = ContactsGridView.Rows(index)
Dim url As String  = row.Cells(2).Text
deletepost(url)

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx
0
 
dj_alikCommented:
1.   public Queue<double>[] queues = new  Queue<double>[2];

2. Queue.Synchronized Method
http://msdn.microsoft.com/en-us/library/system.collections.queue.synchronized.aspx
0
 
dj_alikCommented:
oops
it's  not for for you
0
 
runnerjp2005Author Commented:
 Dim row As GridViewRow = ContactsGridView.Rows(index)

what does this do as i get ContactsGridView is not decleared

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now