is this the right way in vb?

Discussion in 'ASP .Net' started by =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, May 6, 2005.

  1. This works, i adds a confirm box to a datagrid control. However is this the
    correct way to check for the an item or alt item in the onitemdatabound
    event/sub?

    Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
    System.Web.UI.WebControls.DataGridItemEventArgs) Handles
    dgOrders.ItemDataBound
    If e.Item.ItemIndex <> -1 Then
    Dim thslnkBtn As LinkButton
    thslnkBtn = e.Item.FindControl("delThis")
    thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
    sure you wish to delete this item?');")
    End If
    End Sub
    or should it be done like the C# way "if(e.Item.FindControl("DeleteLink") !=
    null))".
    If so how?
    thanks
    kes

    (i like the C# way better:
     
    =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=, May 6, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?S3VydCBTY2hyb2VkZXI=?=

    TJS Guest

    write your code in C# and convert it here

    http://authors.aspalliance.com/aldotnet/examples/translate.aspx



    "Kurt Schroeder" <> wrote in message
    news:...
    > This works, i adds a confirm box to a datagrid control. However is this
    > the
    > correct way to check for the an item or alt item in the onitemdatabound
    > event/sub?
    >
    > Private Sub dgOrders_ItemDataBound(ByVal sender As Object, ByVal e As
    > System.Web.UI.WebControls.DataGridItemEventArgs) Handles
    > dgOrders.ItemDataBound
    > If e.Item.ItemIndex <> -1 Then
    > Dim thslnkBtn As LinkButton
    > thslnkBtn = e.Item.FindControl("delThis")
    > thslnkBtn.Attributes.Add("onClick", "return confirm('Are you
    > sure you wish to delete this item?');")
    > End If
    > End Sub
    > or should it be done like the C# way "if(e.Item.FindControl("DeleteLink")
    > !=
    > null))".
    > If so how?
    > thanks
    > kes
    >
    > (i like the C# way better:
     
    TJS, May 7, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    0
    Views:
    444
  2. =?Utf-8?B?QmlzaG95?=
    Replies:
    0
    Views:
    1,058
    =?Utf-8?B?QmlzaG95?=
    Dec 28, 2006
  3. Bogdan
    Replies:
    1
    Views:
    853
    Bogdan
    Jun 16, 2009
  4. Leon
    Replies:
    3
    Views:
    196
    TaeHo Yoo
    Nov 26, 2004
  5. Oran
    Replies:
    2
    Views:
    610
Loading...

Share This Page