Help in converting C# to VB

Discussion in 'ASP .Net' started by Guest, Oct 4, 2004.

  1. Guest

    Guest Guest

    Can anyone help in converting the code below to VB.NEt!
    protected void myDataGrid_OnItemDataBound(object sender,
    DataGridItemEventArgs e)

    if(e.Item.FindControl("DeleteLink") != null)
    e.Item.FindControl("DeleteLink")).Attributes.Add("onClick", "return
    confirm('Are you sure you wish to delete this item?');");

    Guest, Oct 4, 2004
    1. Advertisements

  2. Guest

    Jos Guest

    Here's a converter:

    In your example though, it has problems with the confirm
    To work around this, replace the "return confirm();" with an
    empty string, and put it back after translation.
    Jos, Oct 4, 2004
    1. Advertisements

  3. Guest

    Craig Guest

    Private Sub myDataGrid_ItemDataBound(ByVal sender As System.Object, ByVal e
    As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
    If (Not e.Item.FindControl("DeleteLink") Is Nothing) Then
    LinkButton).Attributes.Add("onclick", "return confirm('Are you sure you wish
    to delete this item?');")
    End If
    End Sub

    Craig, Oct 4, 2004
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.